Page 1 of 1

Point Adding

Posted: Wed Aug 11, 2004 4:55 pm
by sk8erh4x0r
I'm trying to add up 2 columns that are in 2 different tables:

points in `hof` and score in `mission_scores`

Is there a way to do this with one query or do i need to run 2 different queries and add them together?

Posted: Wed Aug 11, 2004 4:57 pm
by Weirdan
moved to db forum

Posted: Wed Aug 11, 2004 4:58 pm
by Weirdan
what database are you using?

Posted: Wed Aug 11, 2004 5:06 pm
by sk8erh4x0r
both tables are under the same database

Posted: Wed Aug 11, 2004 5:08 pm
by Weirdan
well, I meant 'What db engine, MySQL, MSSQL, Oracle or something?'

Posted: Wed Aug 11, 2004 6:27 pm
by sk8erh4x0r
mysql

Posted: Wed Aug 11, 2004 11:31 pm
by JAM
?

Code: Select all

select
 (hof.points + mission_scores.score) as named
from
 hof, mission_scores
...or if using something to identify what rows to add...

Code: Select all

select
 (hof.points + mission_scores.score) as named
from
 hof
inner join mission_scores on mission_scores.id = hof.id