-=-
.
.....
  
 
RSS
Direkomendasikan menggunakan brower Opera/Chrome/Firefox. Resolusi minimal 1024x768 | Powered by ____ |
 
  
 
Nikmati Delphi-ID dalam berbagai versi tampilan :
Basic View (LOW Bandwidth)
Default View (Full)
Mobile Edition
Main Menu
..:: onWebTools ::..
..:: onLastPosts ::..
goto Postjumlah komponen maksimal dalam sebuah project(6)
 by d4mnf1y32
 on 21.May at 12:16
goto Posttanya grayscale to biner dengan scanline(1)
 by luckynvic
 on 20.May at 20:44
goto Posttanya looping biner to matriks(1)
 by luckynvic
 on 20.May at 20:10
goto Postsql error:acces denied for user....(2)
 by nasbms
 on 19.May at 16:54
goto Postpemanggilan frame(4)
 by nasbms
 on 19.May at 16:14
goto Posttanya AvLock(0)
 by azuriza
 on 19.May at 11:24
goto PostGet TDBEdit Value Menggunakan LookUp Grid(10)
 by henry_sys
 on 18.May at 11:27
goto Postmenghitung record dalam perulangan(4)
 by idhiel
 on 16.May at 13:53
goto Posttanya ascii(4)
 by mas_kofa
 on 16.May at 12:11
goto PostRawPrint Untuk Delphi XE2(0)
 by adewijaya
 on 15.May at 22:34
goto Postdatabase error..(4)
 by idhiel
 on 15.May at 15:57
goto Postbekasi, pt arila putra mahkota(3)
 by mas_kofa
 on 15.May at 15:37
goto Postbagaimana cara membaca file *.doc dg delphi?(0)
 by ficky
 on 15.May at 06:14
goto Posttanya biner to matriks(13)
 by diandewi
 on 14.May at 20:30

..:: onLast Articles ::..
..:: New Download ::..
Pascal-id.Org
Feeds -  Popular -  Latest
RE: The Longue
8 months, 3 weeks ago
RE: belajar pascal
8 months, 3 weeks ago
RE: The Longue
8 months, 3 weeks ago
RE: belajar pascal
8 months, 3 weeks ago
RE: Perkenalan dan Absen
8 months, 3 weeks ago
RE: Alhamdulillah Buka Puasa Bersama
8 months, 4 weeks ago
RE: تَقَبَّلَ اللهُ مِنَّا وَمِنْكَ - Selamat Hari Raya Idul Fitri
8 months, 4 weeks ago
Lintas Situs
«
free web site stats and visitor tracking

Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
batozaiOffline
Location:
Post subject: helppp...query sql  PostPosted: 25/Sep/2009 15:36
onIntermediate


Joined: 08-May-2006
Posts: 52

Status: Offline
para master tanya lagi gimana caranya query utk hasil spt berikut :

aku punya tabel Tmarketing dan Tmarketing_detail
Tmarketing punya ID sbg primary key, id itu digunakan sbg foreign key di Tmarketing_detail.
Tmarketing detail punya field NOMINAL. relasinya dari Tmarketing ke Tmarketing_Detail 1----N
Data di Tmarketing

ID Ket
------------------------------
1 Promosi Ke Jakarta
2 Buat Baliho
3 Study Banding Ke Malaysia

Data di Tmarketing_Detail
Marketing_ID Nominal
----------------------------------
1 200.000
1 300.000
2 200.000
2 300.000
2 100.000
3 400.000
4 300.000

uku ingin mengquery hasil spt ini :

ID Ket Total Nominal
----------------------------------------------------------------------
1 Promosi Ke Jakarta 500.000
2 Buat Baliho 600.000
3 Study Banding Ke Malaysia 700.000

aku dah coba2 beberapa query tapi hasilnya ga mau. malah error terus.
kadang semua baris di Tmarketing detail muncul...


pls help me,


------------------------------------------------------------------------------------
semoga amal dan kebaikan para master mendapat balasan setimpal dari-NYA
 
 View user's profile Send private message  
Reply with quote Back to top
bagussbOffline
Location: Bandung
Post subject: RE: helppp...query sql  PostPosted: 25/Sep/2009 16:48
onSkilled


Joined: 02-Aug-2007
Posts: 113
Location: Bandung
Status: Offline
SELECT ID, KET, SUM(ISNULL(Nominal,0)) AS NOMINAL
FROM TMarketing T0 LEFT OUTER JOIN TMarketing_Detail T1 ON T0.ID = T1.Marketing_ID
GROUP BY ID, KET

_________________
spider boy on action ...
 
 View user's profile Send private message Yahoo Messenger  
Reply with quote Back to top
batozaiOffline
Location:
Post subject: RE: helppp...query sql  PostPosted: 25/Sep/2009 18:13
onIntermediate


Joined: 08-May-2006
Posts: 52

Status: Offline
      Quote:

SELECT ID, KET, SUM(ISNULL(Nominal,0)) AS NOMINAL
FROM TMarketing T0 LEFT OUTER JOIN TMarketing_Detail T1 ON T0.ID = T1.Marketing_ID
GROUP BY ID, KET


terima kasih atas balasannya. saya sudah coba kode diatas. tapi error
error menunjuk ke ISNULL. trus saya del ISSNUL error menunjuk ke ,0 trus saya del akhirnya jadi seperti ini

SELECT ID, KET, SUM(Nominal) AS NOMINAL
FROM TMarketing T0 LEFT OUTER JOIN TMarketing_Detail T1 ON T0.ID = T1.Marketing_ID
GROUP BY ID, KET

dan bisa dieksekusi. saya menggunakan Interbase 7.1
kenapa ya perintah itu tidak dikenal di interbase ?

terimaksih banyak mas bagussb atas bantuannya....
 
 View user's profile Send private message  
Reply with quote Back to top
alhassOffline
Location:
Post subject: RE: helppp...query sql  PostPosted: 25/Sep/2009 19:46
onIntermediate


Joined: 13-May-2009
Posts: 34

Status: Offline
Coba pake query yg biasa sj.

SELECT ID, Ket, SUM(Nominal) AS TOTAL_NOMINAL
FROM TMarketing,TMarketing_Detail
WHERE TMarketing_Detail.Marketing_ID=TMarketing.ID
GROUP BY ID, Ket

dgn query spt ini mungkin akan mudah dipahami. couse masing2 DB memiliki karakteristik berbeda.
 
 View user's profile Send private message  
Reply with quote Back to top
batozaiOffline
Location:
Post subject: RE: helppp...query sql  PostPosted: 26/Sep/2009 07:11
onIntermediate


Joined: 08-May-2006
Posts: 52

Status: Offline
saya coba pake query biasa mau.....

terima kasih banyak atas bantunaanya....
 
 View user's profile Send private message  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT - 12 Hours
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic





Powered by PNphpBB2 © 2003-2009 The Zafenio Team
Credits


| Register | Lost Password ? |