Oracle数据库使用distinct多个字段
程序员文章站
2022-04-27 21:38:50
...
select DISTINCT(t.f_resume_id||t.f_resume_status),t.f_resume_status,t.f_resume_status,t.f_recruit_channel, t.f_sma
select DISTINCT(t.f_resume_id||t.f_resume_status),t.f_resume_status,t.f_resume_status,t.f_recruit_channel,
t.f_small_channel_id
from css.T_RESUME_INFO t where t.f_resume_status in (80011,80012)
distinct多个字段,当然相同的功能也可用group by 完成
select a,b,c,min(d) d
from A
group by a,b,c
通过使用 group就可以出去相同的返回结果。就不需要使用distinct了。
二者效率,最好需要哪个的时候用哪个,group by是用来分组统计的,能用disitnct的地方就不要用group by 了。
网友摘录:
用group by 和rownum嵌套,但distinct 效率高
上一篇: [PHP]讨论下支付宝和微信群红包分配金额的实现思路
下一篇: 连续的分页采集问题
推荐阅读
-
Oracle数据库密码文件的使用与维护
-
在oracle 数据库查询的select 查询字段中关联其他表的方法
-
oracle数据库sqlldr命令的使用
-
Oracle数据库中游标的游标的使用
-
在代码生成工具Database2Sharp中使用ODP.NET(Oracle.ManagedDataAccess.dll)访问Oracle数据库,实现免安装Oracle客户端,兼容32位64位Oracle驱动
-
oracle 实际值超过数据库某个字段指定长度报错解决
-
在oracle数据库里创建自增ID字段的步骤
-
Oracle中Union与Union All的区别(适用多个数据库)
-
oracle数据库中如何处理clob字段方法介绍
-
Oracle数据库操作---基础使用(二)