1、别名

给select语句列加别名,三种方式:

select empno as "员工号",ename "姓名", sal 月薪,sal*12,comm,sal*12+nvl(comm,0) from emp;

(1)其中第一和第二种没有区别

(2)第三中不可以使用特殊字符(空格),不能使用纯数字,如果需要则加双引号

2、distinct关键字

distinct:过滤重复的值 

distinct会作用于后面所有列,就是组合在一起不重复就不会过滤,对比如下:

distinct后面只有一列

别名和distinct关键字

distinct后面有上面两个列:

别名和distinct关键字

相关文章:

  • 2022-12-23
  • 2021-06-08
  • 2021-10-27
  • 2021-08-07
  • 2022-12-23
  • 2021-06-18
  • 2021-09-15
  • 2022-12-23
猜你喜欢
  • 2021-05-17
  • 2022-12-23
  • 2022-12-23
  • 2021-10-01
  • 2021-10-14
  • 2021-12-11
  • 2021-08-10
相关资源
相似解决方案