背景
在 Oracle 中,>=
, <=
, !=
, <>
操作符字符之间允许存在空格。为兼容这种特性,LightDB 24.1 中对这些比较操作符作了特殊处理。
用例
select count(*) from dual where 1 > = 1;
select count(*) from dual where 1 < = 1;
select count(*) from dual where 1 ! = 2;
select count(*) from dual where 1 < > 1;
自定义操作符不会受到影响,
--
-- custom operator should not be affected
--{
create function strong_not_equal(int, int) returns bool as 'select $1 != $2' language sql;
create operator <>= (
function = strong_not_equal,
leftarg = int, rightarg = int
);
--= false
select count(*) from dual where 1 <>= 2;
--= error
select count(*) from dual where 1< >= 2;
--= error
select count(*) from dual where 1 < > = 2;
--= error
select count(*) from dual where 1 <> = 2;
--}
标签:count,lightdb,--,空格,操作符,dual,where,select
From: https://www.cnblogs.com/lddcool/p/17979728