时间:2021-07-01 10:21:17 帮助过:47人阅读
说明:
2.查询表中特定列数据
示例:
SELECT department_id, location_id FROM departments;
注意:
算术运算符
操作符 | 描述 |
+ | 加 |
- | 减 |
* | 乘 |
/ | 除 |
示例:
SELECT last_name, salary, salary + 300 FROM employees;
操作符优先级
操作符优先级示例一:
SELECT last_name, salary, 10*salary+100 FROM employees;
使用括号示例二:
SELECT last_name, salary, 10*(salary+100) FROM employees;
定义空值
示例:
SELECT last_name, job_id, salary, commission_pct FROM employees;
空值在数学运算中的使用
列的别名
使用别名
示例一:
SELECT last_name AS name, commission_pct comm FROM employees;
示例二:
SELECT last_name "Name", salary*12 "Annual Salary" FROM employees;
连接符:
字符串
示例:
SELECT last_name||‘ is a ‘||job_id AS "Employee Details" FROM employees;
重复行
删除重复行
示例:
SELECT DISTINCT department_id FROM employees;
显示表结构
DESCRIBE employees;
Oracle系列二 基本的SQL SELECT语句
标签:指定 last ima 合成 字符连接 des tail img tab