如果有一列的值为null,则数学运算结果就是null。
e.g.
select last_name, 12*salary*commission_pct from employees;
commission_pct为null的行,12*salary*commission_pct结果都是null
别名:
select last_name AS name, commission_pct comm from employees;
select last_name "Name", salary*12 "Annual Salary" from employees;
Concatenation:
select last_name || ' ' || job_id as "Employees" from employees;
Literal Character Strings
字符、日期、数字
必须用单引号括起来
select last_name || ' is a ' || job_id from employees;
转义:
select department_name || ' Department' || q'['s Manager ID:]' || manager_id as "DD" from departments;
重复行:
select DISTINCT department_id from employees;
desc / describe
where子句不可以使用别名:
select first_name ||' ' || last_name as "Name", job_id, department_id did
from employees
where department_id=90;
UPPER/LOWER
字符或日期要用单引号 '19-FEB-96'
=,>,>=,<,<=,(<>,!=,^=), BETWEEN ..AND.., IN(set), LIKE, IS NULL
BETWEEN ..AND.. >= .. and <=...
IN .. OR .. OR ..
LIKE: % 0个或多个 _一个
ESCAPE:
select * from empoyees where job_id LIKE '%SA\_%' ESCAPE '\';
ect * from empoyees where job_id LIKE '%SA|_%' ESCAPE '|';
AND, OR, NOT
ddsf
分享到:
相关推荐
oracle SQL查询工具oracle SQL查询工具oracle SQL查询工具oracle SQL查询工具oracle SQL查询工具oracle SQL查询工具oracle SQL查询工具oracle SQL查询工具oracle SQL查询工具oracle SQL查询工具oracle SQL查询工具...
Welcome to “Beginning SQL for Oracle Database 18C”! Thanks for picking up this book. It’s safe to say you’re interested in learning about Oracle database, as that’s what this book is about. Why ...
Oracle Sql语句转换成Mysql Sql语句java 源码,非常简单,只要给定源oracle sql语句地址,和生成目标文件地址运行即可。
ORACLE SQL性能优化系列 ORACLE SQL性能优化系列 ORACLE SQL性能优化系列
解决oracle sqldeveloper无法连接mysql、SQLServer问题,sqlDeveloper是ORACLE数据库开发工具,自带的是无法连接MS SQL Server以及mysql的,想连接的话需要第三方工具。 使用方法: 解压出来后将2个jar放入jlib...
精通Oracle SQL【第2版】ORACLE SQL高级编程【第二版】学习笔记
Oracle SQL Developer is a relatively new product included in the range of Oracle products. It was frst introduced to the world in September 2005, by its code name Project Raptor. Raptor is a name ...
Oracle SQL 内置函数大全 SQL中的单记录函数 给出整数,返回对应的字符 连接两个字符串 增加或减去月份 用于对查询到的结果进行排序输出
Oracle SQL Tuning with Oracle SQLTXPLAIN: Oracle Database 12c Edition by Stelios Charalambides English | 8 May 2017 | ISBN: 1484224353 | 408 Pages | PDF | 24.39 MB Learn through this practical guide ...
Oracle SQL 11G2 官方文档,包含4份,分别是PLSQL语言参考、PLSQL程序包与类型、Oracle SQL参考、SQL快速参考
Oracle Sql基础(beginning oracle sql中文版)
《Oracle SQL高级编程/数据库系列》的作者莫顿以精炼、风趣的语言揭开了Oracle SQL高级编程的神秘面纱。所涵盖的内容涉及SQL核心、SQL执行、分析函数、联结、测试与质量保证等,并提供大量实用性建议,且总结出...
OracleSQL的优化.pdf
第三章 ORACLE SQL 单行函数 第四章 从多表中查询数据 第五章 用组函数合计数据 第六章 子查询 第七章 操纵数据 第八章 创建和管理表 第九章 内置约束 第十章 创建视图 第十一章 其他数据库对象 第十二章 控制用户...
Oracle SQL*Plus Pocket Reference, 2nd Edition Copyright Oracle SQL*PlusPocket Reference Section 1.1. Introduction Section 1.2. Interacting with SQL*Plus Section 1.3. Selecting Data Section 1.4. ...
资深开发DBA对Oracle SQL编写规范的总结
oracle SQL语法大全!!!!介绍一些基本概念!!!及语法。。。
《精通Oracle SQL 第2版》PDF版本下载
OracleSQL必备参考OracleSQL必备参考OracleSQL必备参考OracleSQL必备参考
oraclesql判断值为空-Oracle-sqlserver的空值(null)判断.pdf