Go4Expert

Go4Expert (http://www.go4expert.com/)
-   Database (http://www.go4expert.com/forums/database-forum/)
-   -   recoding to add an extra row in my query (http://www.go4expert.com/forums/recoding-add-extra-row-query-t15492/)

blackbunny 15Dec2008 07:18

recoding to add an extra row in my query
 
I have a little problem querying here.

we have a table:
stage description region date
2 none N 2007
2 none N 2007
2 test S 2007

I have queried to count the total stages for year 2007

and it appears as, eg:

stage date_2007
2 3

However I now need to separate that 2nd stage. I would like to count the number of stage 2s for year 2007 and region N. And on the next row I would like to count the same (year 2007, stage 2) and the total time S has occured there.

So the output would look like:
stage date_2007
2-N 2
2-S 1

How is it possible to have all this in one query? And how is it possible to make the record appear as 2-N instead of renaming the whole database?

Could I please get some help for this.


All times are GMT +5.5. The time now is 21:05.