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:
@@ -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)
|
||||
|
||||
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