Re: Integer ranges in PostgreSQL - Mailing list pgsql-general

From Gregory Wood
Subject Re: Integer ranges in PostgreSQL
Date
Msg-id 400B350A.9070402@ewebengine.com
Whole thread Raw
In response to Integer ranges in PostgreSQL  (Marco Lazzeri <marco.lazzeri@noze.it>)
List pgsql-general
Marco Lazzeri wrote:
> Does exist a syntax in PostgreSQL for integer (INT) number ranges?
>
> It could be useful for queries like
> "SELECT * FROM table WHERE id IN (range from 1 to 20)"

I believe you're looking for BETWEEN:
SELECT * FROM table WHERE id BETWEEN 1 AND 20;

That is standard SQL and not specific to PostgreSQL

Greg

pgsql-general by date:

Previous
From: "John Wells"
Date:
Subject: Converting from Progress 4GL and DBMS
Next
From: Dave Cramer
Date:
Subject: Re: Converting from Progress 4GL and DBMS