statement ok
create table t(id int primary key, v1 int, v2 int)

statement ok
insert into t values (0, 1, 1), (1, 2, 3), (2, 3, 2), (3, 4, 5)

query II
select * from t where v1 > v2
----
2 3 2

query II
select * from t where v2 > 2
----
1 2 3
3 4 5

query II
select * from t where v1 = 1 or v2 = 2
----
0 1 1
2 3 2

query II
select * from t where v1 = 1 and v2 = 1
----
0 1 1

query I
select sum(v2) from t where v1 <> 1
----
10

query I
select sum(v2) from t where v1 != 1
----
10

statement ok
drop table t

statement ok
create table t(id int primary key, v1 int not null, v2 int not null)

statement ok
insert into t values (0, 0, 1), (1, 1, 3), (2, 3, 2), (3, 4, 5)

query I
select sum(v2) from t where v1 < 1
----
1

query I
select sum(v2) from t where v1 <= 1
----
4

query I
select sum(v2) from t where v1 >= 1
----
10

statement ok
drop table t

statement ok
create table t(id int primary key, v1 int null, v2 int);

statement ok
insert into t values (0, 1, 1), (1, null, 2), (2, null, 3), (3, 4, 4);

query I
select v2 from t where v1 is null;
----
2
3

# query I
# select v2 from t where v1 is not null;
# ----
# 1
# 4

statement ok
drop table t