1、SELECT [DISTINCT] {colunm | expressions} [AS] alias
FROM table;
关键字大写 从句分行写 增加可读性 ISQL*PLUS环境中headings默认大写 居中 别名用来是查询出来的表的意思清楚
若想让headings显示特殊字符 或强制显示其大小写 则用double quotations“包住”字符串 DISTINCT用来eliminate duplicates rows DISTINCT对所有select的columns都有限制作用 sql语句写完后最好加上semicolon
2、连接符 || 连接多个columns成为一个column 通常加 literal 使显示表意思更清楚 合并后的表最好起个 alias
literal 用数字时直接写上 用char or string的时候用 single quotations“包住”
colunm || [' '] || column...... 注意空格 增加可读性
3、null 代表空值 是不确定 未定义的值 不是zero(number) 也不是space(char)
4、DESC[RIBE] table; 用来查询表的结构
5、算术运算符 + - * / 除0会导致error 除null则都为空
PS:
Within a SQL statement, a column alias can be used in both the SELECT clause and the ORDER BY
clause. You cannot use column aliases in the WHERE clause.