PostgreSQL入门到实战
- PostgreSQL查询语句(三)
- 官网地址
- PostgreSQL概述
- PostgreSQL中ORDER BY理论
- PostgreSQL中ORDER BY实操
- 更新计划
 
PostgreSQL查询语句(三)
官网地址
声明: 由于操作系统, 版本更新等原因, 文章所列内容不一定100%复现, 还要以官方信息为准
https://www.postgresql.org/
PostgreSQL概述
PostgreSQL: 世界上最先进的开源关系数据库。
PostgreSQL中ORDER BY理论
-  用法, 指定排序的字段, 当有多个时用逗号(,)分割, 指定是升序还是降序 SELECT select_list FROM table_name ORDER BY sort_expression1 [ASC | DESC], sort_expression2 [ASC | DESC], ...;
PostgreSQL中ORDER BY实操
数据库样例数据来源: https://blog.csdn.net/zwq56693/article/details/137473602
-  示例数据集中根据名字排序, 默认是asc升序 SELECT first_name, last_name FROM customer ORDER BY first_name ASC;

-  根据姓降序 SELECT first_name, last_name FROM customer ORDER BY last_name DESC;

-  根据名字降序, 姓升序 SELECT first_name, last_name FROM customer ORDER BY first_name ASC, last_name DESC;

-  根据表达式排序 SELECT first_name, LENGTH(first_name) len FROM customer ORDER BY len DESC;

-  对包含null的列排序, 可以指定null排在最前或最后 ORDER BY sort_expresssion [ASC | DESC] [NULLS FIRST | NULLS LAST]
更新计划
欲知后事如何, 请听下回分解


![[Java基础揉碎]StringBuffer类 StringBuild类](https://img-blog.csdnimg.cn/direct/601fcbe76d694e809ad0d3422c3a22cd.png)
















