I need to select absolutely all users with a validation date. You need to display the date in the format YYYY-MM-DD. Some users have checkdate = 0. For others who have passed the checkdate check is equal to the correct timestamp.
How to make from_unixtime (checkdate) return 0 if checkdate is 0 and the date is in the format YYYY-MM-DD otherwise, Thank you.
ps Make it one request.