Hi,
Hi all
I have a gui interface that allows 1 single query statement to output results. Now, I would need to output:
a) the total for each project
b) the total for each project in each year
in one query.
hmm... can I join recursivley (join itself) to solve the problem?
What if I need the total costs of Project 4 and the yearly costs next to the total? Hardcoding the years would be fine for me.
TABLE
ProjectID, Year, TotalCosts
2, 2004, 500
2, 2005, 300
3, 2004, 100
4, 2004, 200
4, 2005, 300
4, 2006, 800
RESULT I NEED
ProjectID, ProjectTotal, Year2004, Year2005, Year2006
4, 1300, 200, 300, 800
thanks for any hint
Hi all
I have a gui interface that allows 1 single query statement to output results. Now, I would need to output:
a) the total for each project
b) the total for each project in each year
in one query.
hmm... can I join recursivley (join itself) to solve the problem?
What if I need the total costs of Project 4 and the yearly costs next to the total? Hardcoding the years would be fine for me.
TABLE
ProjectID, Year, TotalCosts
2, 2004, 500
2, 2005, 300
3, 2004, 100
4, 2004, 200
4, 2005, 300
4, 2006, 800
RESULT I NEED
ProjectID, ProjectTotal, Year2004, Year2005, Year2006
4, 1300, 200, 300, 800
thanks for any hint