-
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?
-
Okay, I am willing to let this one go now.
-
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
-
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?
-
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|