llgd.net
当前位置:首页 >> mysql whErE iD in >>

mysql whErE iD in

select * from table where id in(1,2,3,4) union all select * from table where id =3

select id,name from a where id not in (select id from b)

据我测试是65535个

select * from content where id in(15, 35, 55, 69)

不行,代替了就不是SQL语法了 呵呵,果然有办法,你!

用正则试试,,, select *from tablewhere id regexp '[1-9]'这样,,,, 我这垃圾网络,半天才发上

mysql_query("DELECT FROM say WHERE id =$id"); 其中$id是一个变量,需要与sql语句分开来书写。而且delete也写错了。用这一句试试看: mysql_query("delete FROM say WHERE id =".$id);

in 里面不是放字段,而是具体数据 select * from news where ids like '%".$id."%' 这句只适用单个数字的查询

如果是php的话,直接穿进去一个变量 就可以了吧 "select * from userbase where userid in({$str})" 换种方法可以实现不 select * from userbase where userid=str1 or userid=str2 or userid=str3......,这个貌似数字多了就恶心了,但是可以用...

MySQL中NOT IN语句对NULL值的处理2007-07-23 16:01mysql> SELECT COUNT(name) FROM CVE WHERE name NOT IN ('CVE-1999-0001', 'CVE-1999-0002'); +-------------+ | count(name) | +-------------+ | 17629 | +-------------+ 1 row in set (0.0...

网站首页 | 网站地图
All rights reserved Powered by www.llgd.net
copyright ©right 2010-2021。
内容来自网络,如有侵犯请联系客服。zhit325@qq.com