Case statement in MYSQL
Syntax-
Select CASE WHEN(condition) THEN 'Statement'
WHEN(condition) THEN 'Statement'
ELSE 'Statement'
END
Example-
Select Name, CASE WHEN(a.application_status=3) THEN 'Assigned' WHEN(a.application_status=4) THEN 'Submitted' WHEN(a.application_status=8) THEN 'Report Accepted' ELSE 'NA' END as 'Application Status',
From Application a
No comments:
Post a Comment