1
0
mirror of https://github.com/jbranchaud/til synced 2026-01-02 22:58:01 +00:00

Add Checking Inequality as a postgres til

This commit is contained in:
jbranchaud
2016-09-10 12:15:56 -05:00
parent 8940ae0469
commit c6e6353208
2 changed files with 29 additions and 1 deletions

View File

@@ -7,7 +7,7 @@ variety of languages and technologies. These are things that don't really
warrant a full blog post. These are mostly things I learn by pairing with
smart people at [Hashrocket](http://hashrocket.com/).
_466 TILs and counting..._
_467 TILs and counting..._
---
@@ -197,6 +197,7 @@ _466 TILs and counting..._
- [Assumed Radius Of The Earth](postgres/assumed-radius-of-the-earth.md)
- [Auto Expanded Display](postgres/auto-expanded-display.md)
- [Change The Current Directory For psql](postgres/change-the-current-directory-for-psql.md)
- [Checking Inequality](postgres/checking-inequality.md)
- [Checking The Type Of A Value](postgres/checking-the-type-of-a-value.md)
- [Clear The Screen In psql](postgres/clear-the-screen-in-psql.md)
- [Clear The Screen In psql (2)](postgres/clear-the-screen-in-psql-2.md)

View 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)