php - Mysql Case Syntax -
select * case_study order case when expiry_date_case > curdate() 1 end when expiry_date_case null 2 desc end when expire_date_case < curdate() 3 desc end;
when trying run query getting error
#1064 - have error in sql syntax; check manual corresponds mysql server version right syntax use near 'when expiry_date_case null 2 desc end when expire_date_case < curdate() ' @ line 4
where doing wrong?
try
select * case_study order case when expiry_date_case > curdate() 1 when expiry_date_case null 2 when expire_date_case < curdate() 3 end desc
you have many end
's , many desc
's
Comments
Post a Comment