像IN()这样的MySQL?我当前的查询如下所示:SELECT * FROM fiberbox f WHERE f.fiberBox LIKE '%1740 %' OR f.fiberBox LIKE '%1938 %' OR f.fiberBox LIKE '%1940 %'我做了一些环顾四周,却找不到类似于IN()的东西-我设想它是这样工作的:SELECT * FROM fiberbox f WHERE f.fiberbox LIKE IN('%140 %', '%1938 %', '%1940 %')有什么想法吗?难道我只是用错误的方式思考这个问题-一个我从未见过的模糊的命令。MySQL 5.0.77-社区日志
3 回答
慕桂英3389331
TA贡献2036条经验 获得超8个赞
Helenr
TA贡献1780条经验 获得超4个赞
SELECT *FROM fiberbox fJOIN ( SELECT '%1740%' AS cond UNION ALL SELECT '%1938%' AS cond UNION ALL SELECT '%1940%' AS cond ) сON f.fiberBox LIKE cond
fiberbox
'1740, 1938'
SELECT *FROM fiberbox fWHERE EXISTS ( SELECT 1 FROM ( SELECT '%1740%' AS cond UNION ALL SELECT '%1938%' AS cond UNION ALL SELECT '%1940%' AS cond ) с WHERE f.fiberbox LIKE cond )
添加回答
举报
0/150
提交
取消