User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the MySQL section within the Web Development category of DaniWeb, a massive community of 426,425 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,441 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our MySQL advertiser: Programming Forums
Views: 1038 | Replies: 3
Join Date: Jan 2006
Posts: 5
Reputation: Asiima is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
Asiima Asiima is offline Offline
Newbie Poster

MySQL SUM Statemene

  #1  
Apr 19th, 2008
Hi there,

Anyone to help me on sql code for SUM.
I need a query that gets the SUM of one table column and subtract it from the sum from another table column:
I tried this but it gave me wrong answer;

SELECT SUM(i.amount-p.amount) FROM income i, payments p;
Last edited by peter_budo : Apr 20th, 2008 at 6:36 am. Reason: Keep It Organized - please use [code] tags
AddThis Social Bookmark Button
Reply With Quote  

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb MySQL Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Other Threads in the MySQL Forum

All times are GMT -4. The time now is 2:19 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC