首页 / ORACLE / Oracle DQL查询语言整理
Oracle DQL查询语言整理
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了Oracle DQL查询语言整理,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含2245字,纯文字阅读大概需要4分钟。
内容图文
![Oracle DQL查询语言整理](/upload/InfoBanner/zyjiaocheng/1258/97480177ed284ff18677adc1729a3af5.jpg)
1 select * from t_hq_ryxx; 2 3select nianl, xingm from t_hq_ryxx; 4 5select nianl as 年龄, xingm as 姓名 from t_hq_ryxx t; 6 7select nianl 年龄 from t_hq_ryxx; 8 9select nianl || xingm as 年龄和姓名 from t_hq_ryxx; 1011select nianl as hhh,t.* from t_hq_ryxx t order by nianl desc ;--排序 1213select nianl as hhh,t.* from t_hq_ryxx t order by xingb desc ,bum desc; 1415select nianl,xingm,bum,xingb from t_hq_ryxx t order by bum desc nulls last,xingb; 1617select * from t_hq_ryxx order by 3; 1819select nianl,gongz, (nianl+gongz)as g from t_hq_ryxx order by (gongz||nianl); 2021 --去重复 22select distinct bum from t_hq_ryxx; 2324select distinct bum,xingb from t_hq_ryxx; 2526select * from t_hq_ryxx; 272829select * from t_hq_ryxx where xingb = ‘1 ‘and bum = ‘102‘; 3031select * from t_hq_ryxx where (bum = ‘101‘ or bum = ‘102‘) and xingb = ‘2‘and nianl >‘40‘ ; 3233select * from t_hq_ryxx where bum is not null; 3435 --模糊查询 %表示通配符 3637select * from t_hq_ryxx where xingm like ‘三%‘3839select * from t_hq_ryxx where xingm like ‘%儿‘4041select * from t_hq_ryxx where xingm like ‘%三%‘4243select * from t_hq_ryxx where gongz <any (select pingjgz from t_hq_bm); 4445 --值得范围 46select * from t_hq_ryxx where nianl in (‘33‘,‘58‘); 4748select * from t_hq_ryxx where nianl =‘33‘ or nianl = ‘58‘; 4950 --区间范围 5152select * from t_hq_ryxx where gongz between 40 and 100; 5354select * from t_hq_ryxx where gongz >=40 and gongz <= 100; 5556 --子查询 57select * from t_hq_ryxx where bum in (select bumbm from t_hq_bm where lianxdh = ‘10086‘); 5859 --大于最小值,小于最大值 6061select * from t_hq_ryxx where gongz >any (select pingjgz from t_hq_bm); 6263 --大于最大值,小于最小值 646566select * from t_hq_ryxx where gongz >all (select pingjgz from t_hq_bm); 6768 --分组 多种形式 69select bum from t_hq_ryxx group by bum; 7071select bum,count(1) as 数量 from t_hq_ryxx group by bum; 7273select bum,count(1) as 数量,sum (gongz) as 合计 from t_hq_ryxx group by bum; 7475select bum,count(1) as 数量,avg(gongz) as 平均值 from t_hq_ryxx group by bum; 7677select nianl, bum,count(1) as 数量,avg(gongz) as 平均值 from t_hq_ryxx group by nianl, bum; 7879select bum,count(1) as 数量,avg(gongz) as 平均值 from t_hq_ryxx group by bum having avg(gongz)>60; 808182
原文:http://www.cnblogs.com/ymf123/p/4915714.html
内容总结
以上是互联网集市为您收集整理的Oracle DQL查询语言整理全部内容,希望文章能够帮你解决Oracle DQL查询语言整理所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。