I am trying to write a case statement in mysql that checks if a person has booked a room. If they are, return the type of number, otherwise return an informative message.
( CASE WHEN (eab.accommodation_id > 0) THEN (SELECT roomtype FROM event_accomodation WHERE id = eab.accommodation_id) ELSE (IFNULL(eab.accommodation_id, 'No accommodation needed')) END ) AS accommodation
This is the relevant part of the request. If I run it like this, a BLOB is returned for each row in the allocation column. If I change the word "roomtype" to a column that returns an integer, it works fine.
Is there a way to convert BLOB to string in mysql?
Any advice is appreciated.
Thanks.
source share