PostgreSQL
Prev | Chapter 4. Operators | Next

# General Operators

The operators listed here are defined for a number of native data types, ranging from numeric types to data/time types.

Table 4-2. Postgres Operators

Operator | Description | Usage
--- | --- | ---
< | Less than? | 1 < 2
<= | Less than or equal to? | 1 <= 2
<> | Not equal? | 1 <> 2
= | Equal? | 1 = 1
> | Greater than? | 2 > 1
>= | Greater than or equal to? | 2 >= 1
|| | Concatenate strings | 'Postgre' || 'SQL'
!!= | NOT IN | 3 !!= i
~~ | LIKE | 'scrappy,marc,hermit' ~~ '%scrappy%'
!~~ | NOT LIKE | 'bruce' !~~ '%al%'
~ | Match (regex), case sensitive | 'thomas' ~ '.*thomas.*'
~* | Match (regex), case insensitive | 'thomas' ~* '.*Thomas.*'
!~ | Does not match (regex), case sensitive | 'thomas' !~ '.*Thomas.*'
!~* | Does not match (regex), case insensitive | 'thomas' !~* '.*vadim.*'

Prev | Home | Next
Operators | Up | Numerical Operators