Can I use like with CONCAT
? I cannot find anywhere that says otherwise. I'm trying the following and gives an error:
SELECT *, (select count(*) from acts where bookingType like '%CONCAT(bookingTypes_id, ',')%') as how_many FROM bookingTypes order by bookingType
NOTE: I am using CONCAT
with comma because the bookingType
field is basically a list of numbers comma separated e.g. 40,14,45 - and I can't just search for e.g. 4 as it would show when shouldn't - is there a better way to search within that field?