Click here to Skip to main content
15,896,153 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
SQL
 SELECT STATUS,CASE STATUS WHEN 'A' THEN 'Active'
END FROM PROJECT 


I get this error : "ERROR in SELECT clause: expression near WHEN"
Posted
Comments
Hemant Singh Rautela 11-Oct-13 10:59am    
I am not getting any Error as you get...

Only the 2nd coulumn result with unnamed but query runs fine and it shows result also...

I think you have to give alias for the 2nd column. Try this
SQL
SELECT STATUS,CASE STATUS WHEN 'A' THEN 'Active'
END AS NEW_STATUS FROM PROJECT
 
Share this answer
 
SELECT STATUS, CASE WHEN STATUS ='A' THEN 'Active' END AS New_Status FROM PROJECT
 
Share this answer
 
it should not give any error.
Is status column data type is other than varchar?
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900