![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
MySQL
文章平均质量分 68
大哥别带走我呀
这个作者很懒,什么都没留下…
展开
-
DB2迁移Oracle SQL语句改动点
1. 去掉数据库访问中的“with ur”和 “for read only” 关键字,Oracle不支持--DB2select * from userInfo with ur--Oracleselect * from userInfo2. current date改为current_date,current timestamp改为current_timestamp--DB2 insert into coreframe.userInfo (name, createorid, lastmod原创 2021-03-23 09:33:18 · 731 阅读 · 1 评论 -
mysql distinct和group by的区别
distinct先把值取出来,然后去重,分页查询的时候,本来想取N个元素,但是过滤重复元素后,返回的元素个数就会小于等于N只是简单的去重,性能较差group by先做聚集分组,然后返回结果,分页查询的时候,不会出现返回的元素个数小于N的情况。性能更高,且可配合聚合函数使用...原创 2019-12-18 17:24:51 · 432 阅读 · 0 评论 -
Mysql distinct使用
distinct用于过滤重复的记录,之前以为后面只能跟1个字段,后面发现是可以跟多个字段的;select distinct(id) from user;正确,取出user表中,所有不重复的idselect distinct id,name, password from user;正确,取出user表中,所有不重复的id,name, passwordselect id, distinct...原创 2019-08-21 15:07:22 · 131 阅读 · 0 评论