Arsip: Query

 
user image
more 16 years ago

slamet_linux

rekan rekan mau tanya : klo misalnya ada table : //Table Master Nomor Tanggal Kode1 //Table Detail Nomor Kode2 Harga Jumlah Total //////////////////////////////////////////////////////////////+ // Nomor : // Tanggal : // Kode1 : // //------------------------------------------------------------ // NOmor | Kode2 | Harga | Jumlah | Total //------------------------------------------------------------ // // // // // //------------------------------------------------------------ // Total // /////////////////////////////////////////////////////////////// statement sql nya gimana ya ? supaya hasilnya : |==============================+ | Nomor | Tanggal | Total | |==============================+ | xxxx | yyyyyy | zzzzzzz | | xxxx | yyyyyy | zzzzzzz | |==============================+ select a.Nomor, b.Tanggal, .... from Table1 a, table2 b where a.Nomor = b.Nomor order by Nomor tararengkyu
user image
more 16 years ago

ImanD

xixixi mo jawab apa ya, bingung ini pertanyaan dah ke jawab apa emang maksudnya gwe ga ngerti, coba sample datanya skalian bro
user image
more 16 years ago

herux

kalo susah ya pake query tool khan banyak tuh !!
user image
more 16 years ago

Alfando

apa maksutnya mau nampilkan total nomer per tanggal? select a.Nomor, b.Tanggal, count(a.Nomor) from Table1 a, table2 b where a.Nomor = b.Nomor order by Nomor sori kalau salah
user image
more 16 years ago

Alfando

select a.Nomor, b.Tanggal, count(a.Nomor) Total from Table1 a, table2 b where a.Nomor = b.Nomor order by Nomor
user image
more 16 years ago

slamet_linux

@ImanD: xixixi mo jawab apa ya, bingung ini pertanyaan dah ke jawab apa emang maksudnya gwe ga ngerti, coba sample datanya skalian bro
:(( itu yang .... (titik - titik) itu pa, kan itu : select a.Nomor, b.Tanggal, .... from Table1 a, table2 b where a.Nomor = b.Nomor order by Nomor itu yang titik titik kan (sum(total) from Table2 where Nomor = :Nomor) biar jadi satu gimana ?
user image
more 16 years ago

Wong_Jowo

mm... mas slamet mbingungi banget loh,,,

select b.nomor,a.tanggal,sum(b.total)
from table1 a, table2 b
where a.nomor = b.nomor
group by b.nomor
order by b.nomor;
user image
more 16 years ago

slamet_linux

@Wong_Jowo: mm... mas slamet mbingungi banget loh,,,

select b.nomor,a.tanggal,sum(b.total)
from table1 a, table2 b
where a.nomor = b.nomor
group by b.nomor
order by b.nomor;
ok pa, satu pertanyaan lagi, klo misalnya yang di table detail itu field total nya tidak hanya satu misal total1, total2, total3, dst.... gimana query nya ya ?

select b.nomor,a.tanggal,sum(b.total1, b.total2 )
from table1 a, table2 b
where a.nomor = b.nomor
group by b.nomor
order by b.nomor;
kan ga bisa ?
user image
more 16 years ago

ImanD


select b.nomor, a.tanggal, sum(b.total1), sum(b.total2) 
from table1 a, table2 b
where a.nomor = b.nomor
group by b.nomor
order by b.nomor;
coba klo gini
user image
more 16 years ago

Wong_Jowo

bisa kan... group nya berdasarkan b.nomor, jadi dijumlahkan yang nomornya sama

select b.nomor,a.tanggal,sum(b.total1) as total1, sum(b.total2) as total2
from table1 a, table2 b
where a.nomor = b.nomor
group by b.nomor
order by b.nomor;
more ...
  • Pages:
  • 1
  • 2
  • 3
Share to

Random Topic

Local Business Directory, Search Engine Submission & SEO Tools FreeWebSubmission.com SonicRun.com