recoding to add an extra row in my query

Discussion in 'Database' started by blackbunny, Dec 15, 2008.

  1. blackbunny

    blackbunny New Member

    Joined:
    Dec 15, 2008
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    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.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice