Subject | SQL Question |
---|---|
Author | Michael Vilhelmsen |
Post date | 2004-06-03T09:36:31Z |
Hi
I have a table.
This tables has a record for each month of the year.
I can select some values from this month and display them.
I can select a SUM of values from a range of months a display them
But is it posible to do both of the above, and have the return values
on 1 line ?
Exampel:
TABEL
MONTH SOME VALUE
1 11
2 22
3 33
4 44
5 55
6 66
If I select he value from month 6 it'll return 66.
If I select SUM of values where month is greater than or equal to 1
it returns 231.
Can I make a SQL that return both 66 and 231 in some way ?
Michael
I have a table.
This tables has a record for each month of the year.
I can select some values from this month and display them.
I can select a SUM of values from a range of months a display them
But is it posible to do both of the above, and have the return values
on 1 line ?
Exampel:
TABEL
MONTH SOME VALUE
1 11
2 22
3 33
4 44
5 55
6 66
If I select he value from month 6 it'll return 66.
If I select SUM of values where month is greater than or equal to 1
it returns 231.
Can I make a SQL that return both 66 and 231 in some way ?
Michael