Arsip: Query
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
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
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
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
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 ?
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;
more 16 years ago
slamet_linux
@Wong_Jowo: mm... mas slamet mbingungi banget loh,,,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.total) from table1 a, table2 b where a.nomor = b.nomor group by b.nomor order by b.nomor;
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 ?
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
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 ...
reply |
Report Obsolete
Last Articles
Last Topic
- PascalTalk #6: (Podcast) Kuliah IT di luar negeri, susah gak sih?
by LuriDarmawan in Tutorial & Community Project more 4 years ago - PascalTalk #5: UX: Research, Design and Engineer
by LuriDarmawan in Tutorial & Community Project more 4 years ago - PascalTalk #4: Obrolan Ringan Seputar IT
by LuriDarmawan in Tutorial & Community Project more 4 years ago - PascalTalk #2: Membuat Sendiri SMART HOME
by LuriDarmawan in Tutorial & Community Project more 4 years ago - PascalTalk #3: RADically Fast and Easy Mobile Apps Development with Delphi
by LuriDarmawan in Tutorial & Community Project more 4 years ago - PascalTalk #1: Pemanfaatan Artificial Intelligence di Masa Covid-19
by LuriDarmawan in Tutorial & Community Project more 4 years ago - Tempat Latihan Posting
by LuriDarmawan in OOT more 4 years ago - Archive
- Looping lagi...
by idhiel in Hal umum tentang Pascal Indonesia more 12 years ago - [ask] koneksi ke ODBC user Dsn saat runtime dengan ado
by halimanh in FireBird more 12 years ago - Validasi menggunakan data tanggal
by mas_kofa in Hal umum tentang Pascal Indonesia more 12 years ago
Random Topic
- Makan di D'Cost
by zones in Network, Files, I/O & System more 15 years ago - FTP dgn delphi
by mas_kofa in Hal umum tentang Pascal Indonesia more 17 years ago - command out of sync
by yayaretina in MySQL more 17 years ago - program billing warnet
by slam in Tip n Trik Pemrograman more 17 years ago - Database dengan interbase
by Rogeb_Shewrite in Hal umum tentang Pascal Indonesia more 17 years ago - Return function from web service
by EkoIndri in Hal umum tentang Pascal Indonesia more 18 years ago - Cara Trashing (Debug) di DLL
by Joshep in Multimedia & Graphic Enhancement more 18 years ago - field int to field date
by idhiel in MySQL more 12 years ago - tolong di bantu, program testing RFID
by alisiana in Lain-lain more 12 years ago - Midas yang aneh....Ada yang tahu jawabannya ?
by EkoIndri in Tip n Trik Pemrograman more 17 years ago