If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > Sql help

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-11-11, 16:55
cpod500 cpod500 is offline
Registered User
 
Join Date: Jul 2011
Posts: 5
Sql help

say i have a table with home points and away points columns for 10 teams, is there a command that will let me add the points together for each seperate team, and if possible creat a report from it, cheers
Reply With Quote
  #2 (permalink)  
Old 08-11-11, 19:46
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,525
yes, there is, it's called the addition operator, and it is implemented in mysql by the plus sign
Code:
SELECT team
     , home_points + away_points AS total points
  FROM daTable
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
Reply

Tags
sql 2000, sql 2008, sql code completion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On