![]() | |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I'm new to SQL and am having trouble figuring this one out. |
|
I'm new to SQL and am having trouble figuring this one out. |
|
I have 2 tables 'A_Totals' & 'B_Totals' each table is identical in construction, each column is labeled Date,Total1,Total2,Total3 up to Total 18. I have written some sctipts that populates these tables everyday. To get a total e.g of Total3 I have used the following SQL statement For A_Totals: SELECT sum(total3) FROM A_Totals This returns 18596 For B_Totals SELECT sum(total3) FROM B_Totals This returns 21794 I would like to create just 1 SQL statement to return both totals so I tried SELECT sum(A_Totals.total3),sum(B_Totals.total3) FROM A_Totals,B_Totals but this returns 1710832.00 ,1961532.00 and I can't figure out why (i also would like to create a statement that gives me a combined total e.g. SELECT sum(A_Totals.total3) + sum(B_Totals.total3) FROM A_Totals,B_Totals this is returning 3672364.00 Thanks in advance Rich |
#3
| |||
| |||
|
|
I have 2 tables 'A_Totals' & 'B_Totals' each table is identical in construction, each column is labeled Date,Total1,Total2,Total3 up to Total 18. |
|
I would like to create just 1 SQL statement to return both totals so I tried SELECT sum(A_Totals.total3),sum(B_Totals.total3) FROM A_Totals,B_Totals but this returns 1710832.00 ,1961532.00 and I can't figure out why ( |
![]() |
| Thread Tools | |
| Display Modes | |
| |