There is a field called image_src in my table. I would like to get something like a boolean value of 1 if the field contains something ( not null or empty ) else 0 other wise. So is there any function to do that? In PHP we have isset()
Something like :
Select isset(image_src) from table
Take a look here:
SELECT if(image_src is null OR image_src = '', 0, 1) FROM table
This line will check if the field is null or empty.
MySQL has the isnull
function.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With