使用 LIKE 和 IN 的 MYSQL 子查询
我正在尝试组合一个专为 AJAX\PHP CMS 设计的 MYSQL 查询,它有点像这样:
SELECT table.info
FROM table
WHERE table.variable LIKE '%refinedby%' IN
(SELECT other valid subquery to select data from)
但是,我总是在 LIKE '%refinedby'IN 附近出现语法错误(
如果我使用 = 而不是 LIKE 就没有问题,如下所示:
SELECT table.info
FROM table
WHERE table.variable = 'refinedby' IN
(SELECT other valid subquery to select data from)
有谁知道我不能在子查询之前使用 LIKE 选择器吗?
提前致谢!
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 LIKE '%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!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你不能像这样使用 in 你必须指定什么是 in
You can't use in like that you have to specify what is going to BE in