Re: interval query.

From: Mark Volpe <volpe(dot)mark(at)epamail(dot)epa(dot)gov>
To: Antti Linno <alligator(at)all(dot)ee>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: interval query.
Date: 2001-01-31 15:10:49
Message-ID: 3A782AF9.6ED86F88@epamail.epa.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Try

SELECT * FROM Towns WHERE id=9999 OR id BETWEEN 3 AND 12

Antti Linno wrote:
>
> Good morning.
>
> Is there some way to make interval query?
>
> Towns table(estonia towns, heh :P)
>
> id | name
>
> 1 Elva
> 2 Tartu
> 9999 Tallinn
> 3 Tallinn/Haabersti
> 4 Tallinn/Mustamae
> ...
> etc.
>
> What I need is when the town's id=9999 I want to make query
> where id=9999 OR id=[3..12] for example. I could generate bunch of OR's
> like id=3 OR id=4 ... but is there some more elegant solution?
>
> Greetings,
> Antti

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Sveinung Haslestad 2001-01-31 15:14:28 Array parameter to plpgsql-functions
Previous Message Michael Fork 2001-01-31 14:43:11 Re: no value for numeric filed in SQL statement causes an error