SELECT这一块仔细听来东西还是有不少的饿,今天记录的内容都还没理解完全呢,还得明天补。
1、列的别名
|
语法 |
描述 |
|
列 AS 别名 |
最容易阅读的技术,不过在SQL的纯化论者中间不流行 |
|
列 别名 |
最通常的技术。多数自动生成的代码是以这种形式书写的 |
2、连接操作符
在SQL中的select语句中使用字符串连接符号“||”(Concatenation Operator)
3、Literal Character Strings(转载jaunt 的例子)
实际上是说,你双引号中是什么字符串,最终的结果,就是按照双引号中的内容原样使用。
举两个比较典型的例子,注意看所显示的列名:
--------------------------------------------------------------------------------
SQL> select 1 as num from dual;
NUM
----------
1
SQL> select 1 as "num" from dual;
num
----------
1
SQL> create table testa (test varchar2(10));
Table created
SQL> desc testa
Name Type Nullable Default Comments
---- ------------ -------- ------- --------
TEST VARCHAR2(10) Y
SQL> create table testb ("test" varchar2(10));
Table created
SQL> desc testb
Name Type Nullable Default Comments
---- ------------ -------- ------- --------
test VARCHAR2(10) Y
4、alternative Quote(q) Operator
5、DISTINCT ,DESC
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/26006637/viewspace-706157/ ,如需转载,请注明出处,否则将追究法律责任。