I have a table name video
table video
id name upload_date
1 one 1408336348
2 two 1409884215
now i want to select all data also calculate if video uploaded between last 2 days then yes or no
result like
id name upload_date new
1 one 1408336348 no
2 two 1409884215 yes
I am using this query but not work
SELECT v.*,( if(from_unixtime(v.upload_date) < NOW() - INTERVAL 2 DAY) then 'no' else 'yes')
AS new FROM `video` as v
Query return error
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') then 'no' else 'yes')
AS new FROM `video` as v
LIMIT 0, 25' at line 1