DBAsupport.com Forums - Powered by vBulletin
Results 1 to 5 of 5

Thread: SQL q !!

Threaded View

  1. #1
    Join Date
    Jul 2003
    Posts
    323

    Smile SQL q !!

    Is this possible through SQL:

    We have a table with a date column and another which is populated with a flag(rule) from another table which has a bunch of rules.

    So the data is like this:

    TDATE RULES
    ----------- ------
    1-Oct-2004 1884.1886
    2-Nov-2005 1921.
    4-Jan-2006 1884.
    7-Nov-2006

    Each of the values (1884,1921) is a rule in another table and is concatenated with a dot (.) and inserted into the above table.

    First we wanted the count of rules by month so this worked:

    select to_char(DATE,'Mon YYYY'), count(RULES)
    from DETAIL
    where RULES IS NOT NULL
    group by rollup(to_char(DATE,'Mon YYYY'))
    order by to_date(to_char(DATE,'Mon YYYY'),'Mon YYYY')

    Now we need a count of individual rules by month - each 4 digit number above is a rule.

    Is this possible through SQL ?

    Rgds.,
    Last edited by cruser3; 03-29-2006 at 03:26 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width