Starr Duskk
asked on
Attaching a column for the case statement results in sql query
I would like to name my case statement values so I can display it as a column to see what's happening. Here is my code:
I have another query that uses:
But when I try something like that with this, it doesn't work.
Help?
thanks!
SELECT NavMenu.*
from NavMenu
left outer join navmenu as nm on navmenu.parentnavmenuid = nm.navmenuid
WHERE
NavMenu.NavMenuGroupCode IN (2609)
AND
NavMenu.NavMenuName LIKE '%test%'
order by navmenu.navmenugroupcode desc,
case when navmenu.isparentnavmenu = 1 then navmenu.listorder
Else nm.listorder
END ASC,
case when navmenu.isparentnavmenu = 1 then 0
else 1
END ASC,
NavMenu.ListOrder
I have another query that uses:
End as 'GlobalOrder'
But when I try something like that with this, it doesn't work.
Help?
thanks!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Also I don't see 'GlobalOrder' in your posted solution, so hard to see how that worked for you.
Also as long as the name does not include spaces or punctuation marks other than underscore, the single quotes ' ' are not needed.