DB操作用法总结。

用到了慢慢总结。用到了随时更新。

其实可以看手册了。但是看了完了手册之后,还是记不住。

1. mysql select * from table where id in(1,2,3,3,4) 怎么能显示两次ID=3这一列?

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

2. mysql select * from lsdl_user where id in (1,2,3,4,5)中in()最多能放多少数字

 in()中的个数是没有限制的, in(1,2,3)只是它的简单用法,如果你在学习in(),知道这样实现还不够,sql语句一般都是联合用的,比如 .........in(select uid from ........where .......) 如果你在学习php 应该知道 implode(), 比如 $uid_arr=array(..........); $uid_str=implode(',',$uid_arr);

 
 
3. select 用法
http://blog.sina.com.cn/s/blog_a74f39a201013c3b.html
 
4. w3school
原文地址:https://www.cnblogs.com/shaohef/p/5728358.html