![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
自己看的
海边的陌生人
学如逆水行舟,不进则退
展开
-
数据库字段字符时进行区间查询
2018.1.18日当使用字符串进行连续的模糊查询时,or 需要加()。or 和and相当于数字运算中的加法和乘法 sql条件在连接条件的时候会先算and两端的 在跟or两端的进行运算。select * from table where 1=1 and (xmmc like '%xxx%' or cgdw like '%xxxx%' or sheng like '%xxxx%') and 字符原创 2018-01-18 16:27:16 · 5499 阅读 · 0 评论 -
Duplicate entry '0' for key 'PRIMARY'
ID为主键,默认是不能为空的也不能重复,初始值是0;如果不设置自动递增,当插入第一条ID的值就为0;当插入第二条时ID的值还是为0;这时ID的值就重复了。所以将ID改为自动递增就可以了...原创 2018-04-03 14:14:07 · 404 阅读 · 0 评论 -
delete使用表链接删除两个表相同的数据
select * from t1 join t2 on t1.id = t2.iddelete t1 fromt1 join t2 on t1.id = t2.id 删除使用表链接时需要指定删除的表名,自己老是忘,记录一下原创 2019-10-08 18:08:58 · 1040 阅读 · 0 评论 -
java遍历文件夹下的所有文件,并且返回一个集合
public static void main(String[] args) { List<File> list = new ArrayList<File>(); File file = new File("D:XXX"); func(file,list); for(File nf:list){ //此时list中已经有文件了...原创 2019-10-08 18:17:35 · 1206 阅读 · 0 评论