mirror of
https://github.com/jbranchaud/til
synced 2026-01-03 07:08:01 +00:00
Add Checking Inequality as a postgres til
This commit is contained in:
27
postgres/checking-inequality.md
Normal file
27
postgres/checking-inequality.md
Normal file
@@ -0,0 +1,27 @@
|
||||
# Checking Inequality
|
||||
|
||||
In most languages there is a `!=` operator for checking inequality of two
|
||||
things.
|
||||
|
||||
Postgres also supports the synonymous `<>` operator for checking inequality.
|
||||
|
||||
```sql
|
||||
> select 1 <> 1;
|
||||
?column?
|
||||
----------
|
||||
f
|
||||
|
||||
> select true <> false;
|
||||
?column?
|
||||
----------
|
||||
t
|
||||
|
||||
> select 'taco' <> 'burrito';
|
||||
?column?
|
||||
----------
|
||||
t
|
||||
```
|
||||
|
||||
h/t Brian Dunn
|
||||
|
||||
[source](https://www.postgresql.org/docs/9.5/static/functions-comparison.html)
|
||||
Reference in New Issue
Block a user