Go Back   Webmaster Malaysia Forum » Website Design & Development » Website Programming

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 04-10-2004, 04:00 PM
New kid on the block
 
Join Date: Oct 2004
Location: ktn
Posts: 8
Rep Power: 0
nixx is on a distinguished road
Sql query untuk A+B-C ...

Aku ade 2 table dalam 1 database mysql sebagai contoh

Table1
- fieldA
- fieldB

Table2
- sum(fieldC)

Jadi macamana nak query angka dalam fieldA + fieldB - sum(fieldC)

Terima kasih
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-10-2004, 05:38 PM
Gemp-X's Avatar
Novice Webmaster
 
Join Date: Apr 2002
Location: kuantan, pahang
Posts: 58
Rep Power: 80
Gemp-X is on a distinguished road
Send a message via Yahoo to Gemp-X
Select (table1.fieldA+table1.fieldB-sum(table2.fieldc))
AS jumlah FROM table1,table2
__________________
http://sidik.org/
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 05-10-2004, 12:32 PM
New kid on the block
 
Join Date: Oct 2004
Location: ktn
Posts: 8
Rep Power: 0
nixx is on a distinguished road
Terima kasih Gemp-X

Sql tu ok apabila dalam senarai saye ade 1 item je apabila dalam senarai ade lebih dari 1 item sql tu tak menjadik ahhh...
Mungkin kena tambah filter kot tapi macamana ehh sebab saye ni masih baru lagi dalam sql ni ...

Harap tolong ye... terima kasih
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 05-10-2004, 04:07 PM
Gemp-X's Avatar
Novice Webmaster
 
Join Date: Apr 2002
Location: kuantan, pahang
Posts: 58
Rep Power: 80
Gemp-X is on a distinguished road
Send a message via Yahoo to Gemp-X
eh sori, terkurang.. camni
kat table1 tu tambah satu field primary key id (integer, auto_increment)

Select (table1.fieldA+table1.fieldB-sum(table2.fieldC))
AS jumlah FROM table1,table2 GROUP BY table1.id

dengan tambah primary key id tu & GROUP BY id, dia akan return bilangan row ikut setiap id, kalo tak, memang error la kalo ade lebih dari 1 rekod.

**off topic, tak berkenaan dgn yg ni.aku pelik la, apsal asal ade org tanye je, ade je yang menjawab..cari la kat google, banyak script [ fullstop], of course la banyak script, kurang2 bagi la hint..keyword ke, URL ke.. kalo tak tau, cakap je la tak tau jangan pandai2.kecuali la kalo soalan 2 soalan yg org da biase sangat tanye, mcm, cmne nk buat website, cmne nk blaja PHP, tolong aku!!! etc..kalo semua soalan dijawab 'cari kat google' tak guna la ber forum ni kan ?any arqument
__________________
http://sidik.org/

Last edited by Gemp-X; 05-10-2004 at 04:20 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 05-10-2004, 05:03 PM
Novice Webmaster
 
Join Date: Sep 2004
Location: Shah Alam
Posts: 68
Rep Power: 52
infeeneetee is on a distinguished road
** off topic **
saya sokong... apa guna bukak forum kalau takleh bertanya.. mungkin diorg pasai php dah terer cuma skang nie kena belajar bab etika plak kot...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 06-10-2004, 04:51 PM
New kid on the block
 
Join Date: Oct 2004
Location: ktn
Posts: 8
Rep Power: 0
nixx is on a distinguished road
Jadik aahh ...

terima kasih pada anda semua kerana sudi menolong

** off topic **
manusia ni ade banyak ragam usah peduli ... teruskan niat baik kita
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Why my Query Not Working?? marukochan Website Programming 3 05-04-2007 02:10 PM
Skrip Untuk Semua Ni! List Website Design 3 05-10-2004 10:26 PM
how to secured query string vash Website Programming 3 28-04-2004 02:47 PM
Domain Untuk CGI kerenggeforum Free Hosting Discussion Forum 4 01-08-2003 11:12 AM
Ada Tak FreeServer Untuk ColdFusion Rizalnet Website Programming 4 11-07-2002 11:05 PM



All times are GMT +8. The time now is 03:04 PM. Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.1.0 vBulletin skin by ForumMonkeys.com.


WebmasterMalaysia.com is Proudly Hosted by Exabytes Semi Dedicated Server.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59