View previous topic :: View next topic
|
Author |
Message |
d_sarlie
New User
Joined: 22 Apr 2008 Posts: 42 Location: coimbatore
|
|
|
|
I have a table which has ten columns.In one of the column I have month.The value will be like "Jan" "Feb" "Mar" etc.,.These records are not ordered based on month.I want to write a query which will give me the jan data first then Feb data and so on.
Can someone help me out. |
|
Back to top |
|
|
sushanth bobby
Senior Member
Joined: 29 Jul 2008 Posts: 1020 Location: India
|
|
|
|
Sarlie,
Try like the following,
Code: |
select id,
(case month
when 'Jan' then '1'
when 'Feb' then '2'
when 'Mar' then '3'
when 'Apr' then '4'
when 'Jun' then '5'
END ) as mon
from table1
order by mon |
Start Reading 'DB2 V9 SQL reference' Manual.
Sushanth |
|
Back to top |
|
|
|