Return default value if no results found in SQL query

时间:2015-05-12 22:52:39

标签: mysql sql

I currently am using this query to select "profile_picture from the column relation and table media, although I noticed my return default.png inside my html image tag doesn't work for results. Is there any way I could return: IF error

UIImagePickerController

My current query

"SELECT * FROM media WHERE post_id = '5552773e65a2b' AND relation = 'profile_picture"

1 个答案:

答案 0 :(得分:1)

While this would probably be easier to handle with your scripting language, you could do a apscheduler to get the default value since you're ordering by the union all field:

id
相关问题