Comparison 比较操作符 oracle /mssql 对比
来源:互联网 发布:小欧工程师软件 编辑:程序博客网 时间:2024/05/29 17:52
Same in Both SQL Server Server
Operator Databases Only Oracle Only
Equal to =
Not equal to != ^=
<>
Less than <
Greater than >
Less than or equal to <= !>
Greater than or equal to >= !<
Greater than or equal to x BETWEEN x
and less than or equal to y AND y
Less than x or greater than y NOT
BETWEEN x
AND y
Pattern Matches LIKE 'a%' LIKE'a[x-z]' LIKE 'a\%'
a followed by 0 or more LIKE 'a_' LIKE'a[^x-z]' ESCAPE '\'
characters
a followed by exactly 1
character
a followed by any character
between x and z
a followed by any character
except those between x and
z
a followed by %
Does not match pattern NOT LIKE
No value exists IS NULL
A value exists IS NOT NULL
At least one row returned by EXISTS
query (query)
No rows returned by query NOT EXISTS
(query)
Equal to a member of set IN =ANY = SOME
Not equal to a member of set NOT IN != != SOME <>
ANY <> SOME
ANY
Less than a member of set < ANY < SOME
Greater than a member of set > ANY > SOME
Less than or equal to a <= ANY !> ANY <= SOME
member of set
Greater than or equal to a >= ANY !< ANY >= SOME
member of set
Equal to every member of set =ALL
Not equal to every member of != ALL <>
set ALL
Less than every member of < ALL
set
Greater than every member > ALL
of set
Less than or equal to every <= ALL !> ALL
member of set
Greater than or equal to every >= ALL !< ALL
member of set
Recommendations:
1. Convert all !< and !> to >= and <=
Convert the following in Microsoft SQL Server or Sybase Adaptive Server:
WHERE col1 !< 100
to this for Oracle:
WHERE col1 >= 100
1. Convert like comparisons which use [ ] and [^]
SELECT title
FROM titles
WHERE title like "[A-F]%"
1. Change NULL constructs:
Table 2–12 shows that in Oracle, NULL is never equal to NULL. Change the all =
NULL constructs to IS NULL to retain the same functionality.
Table 2–12 Changing NULL Constructs
Microsoft SQL Server or
NULL Construct Sybase Adaptive Server Oracle
where col1 = NULL depends on the data FALSE
where col1 != NULL depends on the data TRUE
where col1 IS NULL depends on the data depends on the data
where col1 IS NOT NULL depends on the data depends on the data
where NULL = NULL TRUE FALSE
If you have the following in Microsoft SQL Server or Sybase Adaptive Server:
WHERE col1 = NULL
Convert it as follows for Oracle:
WHERE col1 IS NULL
- Comparison 比较操作符 oracle /mssql 对比
- Select 语句 oracle /MSSQL 对比
- UPDATE 语句 ORACLE /MSSQL 对比
- DELETE 语句 oracle /mssql 对比
- Arithmetic Operators 算术操作符 oacle/mssql 对比
- select 语句 没有 FROM oracle /MSSQL 对比
- select into 语句 ORACLE / MSSQL对比
- String Operators 字符串 oracle/mssql 对比
- oracle与MSSQL函数对比记忆
- Oracle和MSSQL语句方面的比较
- MySql Oracle 日期比较对比
- ORACLE与MSSQL之【常用函数对比篇】
- C++ - 数值比较numerical comparison
- oracle和mssql中复制表的比较
- MSSQL操作
- HBase vs. BigTable Comparison - HBase对比BigTable
- MYSQL\MSSQL\Oracle的换行符
- pig 的chararry类型不能用比较运算符comparison operator
- 高效程序员秘籍(3):使用MindManager进行可视化的思维管理
- CLSID Type Library 保证全球唯一
- 高效程序员秘籍(4):使用Total Commander替换Windows资源管理器
- 搭建自己的Wiki ,用于发布进度和自己的工作心得
- 求最大子序列和及其位置(四种经典方法)
- Comparison 比较操作符 oracle /mssql 对比
- GoF著作中未提到的设计模式(7):Publish-Subscribe
- QImage与QPixmap完全解析
- 我的博客地址
- 修改MyEclipse 8.6中jsp页面默认打开方式
- ASIHTTPRequest系列(一):同步和异步请求
- VC MFC 自定义消息
- 高效程序员秘籍(6):使用CLCL加快写代码的速度
- 使用debug反汇编com文件