lnnvl

最近更新时间: 2025-02-18 16:02:00

传入表达式为true 返回false;传入为false 返回true。

  • 复制
    复制成功
postgres=# create table t_lnnvl(f1 integer, f2 integer);
CREATE TABLE
postgres=# 
postgres=# insert into t_lnnvl values(1,1);
INSERT 0 1
postgres=# 
postgres=# insert into t_lnnvl values(1,2);
INSERT 0 1
postgres=# 
postgres=# insert into t_lnnvl values(1,3);
INSERT 0 1
postgres=# 
postgres=# insert into t_lnnvl values(1,4);
INSERT 0 1
postgres=# 
postgres=# insert into t_lnnvl values(1,null);
INSERT 0 1
postgres=# select * from t_lnnvl where lnnvl(f2>2);
 f1 | f2 
----+----
  1 |  1
  1 |  2
  1 |   
(1 rows)