I have the following string stored in a field in mysql:
a:11:{i:0;s:6:"BFA.AD";i:1;s:11:"BFA.AD.COPY";i:2;s:6:"BFA.AE";i:3;s:6:"BFA.TC";i:4;s:6:"BFA.FA";i:5;s:6:"BFA.GC";i:6;s:6:"BFA.IL";i:7;s:6:"BFA.IN";i:8;s:6:"BFA.PH";i:9;s:6:"BFA.PR";i:10;s:6:"BFA.TR";}
I am trying to write a case when statement that matches BFA.AD but not BFA.AD.COPY.
I have tried:
case when (select m.meta_value from `ccsadm_frm_item_metas` m where m.item_id = i.id and m.field_id = 1308) like '%BFA.AD%' then 1 else 0 end as 'BFA.AD',
which marks both BFA.AD and BFA.AD.COPY as 1. I have tried using the regular expression ["]\bBFA.AD\b["], but that does not seem to work in MySQL.
Aucun commentaire:
Enregistrer un commentaire