从我的表格中,我有一个这样的日期范围:
05/16 / 2016,05 / 17 / 2016,05 /二千零十六分之十八
我的桌子里面有:
-----------------------------------
ID | Key | Value
-----------------------------------
10 | mydt | 05/14/2016,05/15/2016,05/16/2016,05/17/2016, 05/18/2016,05/19/2016,05/20/2016
我必须搜索我的$ _POST ['date']是否在内部值,以下将不起作用:
SELECT * FROM my_table WHERE key = mydt AND value LIKE '%05/16/2016,05/17/2016,05/18/2016%'
SELECT * FROM my_table WHERE key = mydt AND value IN('05/16/2016','05/17/2016','05/18/2016')
请问如何处理?谢谢你的帮助
答案 0 :(得分:1)
您可能忘记了or
或and
命令
SELECT * FROM my_table WHERE key = mydt AND value LIKE '%05/16/2016% or LIKE '%05/17/2016%' or LIKE '%05/18/2016%'
试试吧......