我有一个包含由双管分隔的值的单元格.我试图用以下内容搜索这个单元格的内容,(其中10是要搜索的数字)?,10%,?%和10
我的查询似乎只返回10.没有其他变化.有人可以告诉我为什么它不起作用?
提前谢谢了. (您在下面看到的SQL查询是从准备好的PDO查询语句中导出的内容)
SELECT `Hat`.`id` AS `Hat_id` , `Hat`.`hatCode` AS `Hat_hatCode` , `Hat`.`hatCodeOther` AS `Hat_hatCodeOther` , `Hat`.`name` AS `Hat_name` , `Hat`.`description` AS `Hat_description` , `Hat`.`colorId` AS `Hat_colorId` , `Hat`.`collectionId` AS `Hat_collectionId` , `Hat`.`mainPicture` AS `Hat_mainPicture` , `Hat`.`subPicture` AS `Hat_subPicture` , `Hat`.`type` AS `Hat_type` , `Hat`.`featured` AS `Hat_featured` , `Hat`.`published` AS `Hat_published` , `Hat`.`deleted` AS `Hat_deleted`
FROM `modx_hats` AS `Hat`
WHERE (
(
`Hat`.`published` =1
AND `Hat`.`collectionId` = '1'
)
AND `Hat`.`colorId` = '%||10||%'
OR `Hat`.`colorId` = '10||%'
OR `Hat`.`colorId` = '%||10'
OR `Hat`.`colorId` = '10'
)
LIMIT 0 , 30