I'm trying to put together a MYSQL query designed for an AJAX\PHP CMS, which goes a little like this:
SELECT table.info
FROM table
WHERE table.variable LI开发者_如何学运维KE '%refinedby%' IN
(SELECT other valid subquery to select data from)
However, I keep tripping syntax errors near LIKE '%refinedby'IN (
If I use = rather than LIKE there's no problem, as the following:
SELECT table.info
FROM table
WHERE table.variable = 'refinedby' IN
(SELECT other valid subquery to select data from)
Does anyone have any ideas where I can't preceed a subquery with a LIKE selector?
Thanks in advance!
You can't use in like that you have to specify what is going to BE in
SELECT table.info
FROM table
WHERE table.variable LIKE '%refinedby%'
and table.variable IN (SELECT other valid subquery to select data from)
精彩评论