DBAsupport.com Forums - Powered by vBulletin
Page 2 of 2 FirstFirst 12
Results 11 to 15 of 15

Thread: Total number of requests per day of the week

  1. #11
    Join Date
    Dec 2000
    Location
    Ljubljana, Slovenia
    Posts
    4,439
    Originally posted by stecal
    Yes, but the days of the week are not in the order we normally associate with this type of list. Days of the week in alphabetical order does nothing for us in this query.
    That's why ORDER BY clause was invented in SQL, I guess.

    Using
    Code:
    group by to_char(hiredate, 'DAY')
    doesn't prevent you from adding an additional order by clause like
    Code:
    order by to_char(hiredate, 'D')
    Jurij Modic
    ASCII a stupid question, get a stupid ANSI
    24 hours in a day .... 24 beer in a case .... coincidence?

  2. #12
    Join Date
    May 2002
    Posts
    2,645
    Okay, I am willing to let this one go now.

  3. #13
    Join Date
    Jan 2003
    Posts
    1
    select Weekday, Hired
    from(select to_char(hiredate, 'D'),to_char(hiredate, 'DAY') WEEKDAY, count(*) hired
    from emp
    group by to_char(hiredate, 'D'),to_char(hiredate, 'DAY')) dTab

  4. #14
    Join Date
    Dec 2000
    Location
    Ljubljana, Slovenia
    Posts
    4,439
    Originally posted by skanth76
    select Weekday, Hired
    from(select to_char(hiredate, 'D'),to_char(hiredate, 'DAY') WEEKDAY, count(*) hired
    from emp
    group by to_char(hiredate, 'D'),to_char(hiredate, 'DAY')) dTab
    But of course! Why make it simple if you can make it complicated!
    Jurij Modic
    ASCII a stupid question, get a stupid ANSI
    24 hours in a day .... 24 beer in a case .... coincidence?

  5. #15
    Join Date
    May 2002
    Posts
    2,645
    I thought this horse was dead already...

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