Skip to content

Instantly share code, notes, and snippets.

@briu
Created May 28, 2019 08:00
Show Gist options
  • Save briu/1f8f52b159719964094fe28d9fac57c2 to your computer and use it in GitHub Desktop.
Save briu/1f8f52b159719964094fe28d9fac57c2 to your computer and use it in GitHub Desktop.
CREATE TABLE tmp4(tmp_id integer);
insert into tmp4 (tmp_id) values (1), (2), (null);
select count(order_id <> 1) from (values (null),(1),(2)) t(order_id);
count
-------
2
select count(*) from tmp4 where tmp_id <> 1;
count
-------
1
(1 row)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment