<!--Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->SELECT si.user_id FROM ecs_store_info AS si WHERE si.store_name like (SELECT wl.store_name FROM ecs_wpaqq_log AS wl WHERE wl.lngShopId=0)
就是如何在like关键后使用select语句
------解决方案-------------------- LZ的想法我大致明白,但是like是模糊匹配一串字符。LZ如果是想在很多个字符里面,随便模糊匹配任意一个,只能用in或者通过PHP遍历结果然后重新sql,这个目前没见过如何在一条sql里面实现的,不过应该有大神能做到吧,这我就不清楚了。 ------解决方案-------------------- 用下面这句,我在Oracle里面测试是可以的: select * from users u where u.name like '%'||(select name from users where id=1)||'%'; ------解决方案-------------------- LS,如果子查询中只能取出唯一一条数据,那么LZ的问题就不是问题了。
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn