oracle中怎么降序,oracle中升序

oracle中怎么用升序和降序排列

在sql最后加上 升序 order by table.column asc

成都创新互联公司是一家专业提供多伦企业网站建设,专注与成都网站设计、网站制作html5、小程序制作等业务。10年已为多伦众多企业、政府机构等服务。创新互联专业网站制作公司优惠进行中。

降序 order by table.column desc

oracle中不用ORDER BY怎么实现排序?

ORDER BY的含义就是通过某个字段进行排序(默认是ASC,可以省略)。\r\nsql:select * from scores order by score DESC;\r\n以上语句就是通过score字段进行降序排序。\r\nsql:select * from scores order by score ;\r\n以上语句就是通过score字段进行升序排序。\r\n备注:DESC表示降序,ASC表示升序。

送分题,Oracle降序和升序

1、创建测试表,

create table test_name(id varchar2(20),name varchar2(20), birthday date);

2、插入测试数据;

insert into test_name values(1, 'aa', to_date('1990-01-02 10:10:50','yyyy-mm-dd hh24:mi:ss'));

insert into test_name values(2, 'bb', to_date('1987-02-02 10:01:25','yyyy-mm-dd hh24:mi:ss'));

insert into test_name values(3, 'cc', to_date('2000-01-25 09:01:25','yyyy-mm-dd hh24:mi:ss'));

commit;

3、编写语句,根据birthday字段进行升序;

select * from test_name t order by birthday;

4、编写语句,根据birthday字段进行降序;

select * from test_name t order by birthday desc;


分享名称:oracle中怎么降序,oracle中升序
网页网址:http://www.hxwzsj.com/article/dsdpcdj.html

其他资讯

Copyright © 2025 青羊区翔捷宏鑫字牌设计制作工作室(个体工商户) All Rights Reserved 蜀ICP备2025123194号-14
友情链接: 成都网站设计 成都网站制作 四川成都网站建设 成都企业网站制作 手机网站建设 成都做网站建设公司 营销网站建设 广安网站设计 四川成都网站设计 成都网站设计 LED网站设计方案 成都网站设计 网站制作 网站制作 成都网站建设 教育网站设计方案 成都网站制作 成都网站建设 成都网站建设 企业网站设计 移动手机网站制作 外贸网站建设