maqskywalker
asked on
sql server 2008 query
I have a table and a query that looks like this.
http://sqlfiddle.com/#!3/157bb/1
If you notice in my query I used a CASE statement to create a new column called OrderMonth2 which holds the actual name of the month pertaining to the value stored in the column called OrderMonth.
The naming of the months goes according to this table:
My query creates the OrderMonth2 column correctly. In my example I use a case statement.
Is there a better way to write this query?
I just wrote this query in a rush, but figured there might be a better way to get the same result set.
http://sqlfiddle.com/#!3/157bb/1
If you notice in my query I used a CASE statement to create a new column called OrderMonth2 which holds the actual name of the month pertaining to the value stored in the column called OrderMonth.
The naming of the months goes according to this table:
My query creates the OrderMonth2 column correctly. In my example I use a case statement.
Is there a better way to write this query?
I just wrote this query in a rush, but figured there might be a better way to get the same result set.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
, datename(month,dateadd(mon
(never say never around here :)