Received: from nts1.rtp.epa.gov (nts1.rtp.epa.gov [134.67.208.208]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id f0VFBqq44610 for ; Wed, 31 Jan 2001 10:11:52 -0500 (EST) (envelope-from volpe.mark@epamail.epa.gov) Received: from epamail.epa.gov (scanmeifyoudare.rtp.epa.gov [134.67.139.14]) by nts1.rtp.epa.gov (8.9.3/8.9.3) with ESMTP id KAA30397; Wed, 31 Jan 2001 10:15:29 -0500 (EST) Message-ID: <3A782AF9.6ED86F88@epamail.epa.gov> Date: Wed, 31 Jan 2001 10:10:49 -0500 From: Mark Volpe X-Mailer: Mozilla 4.75 [en] (X11; U; Linux 2.2.17-21mdk i686) X-Accept-Language: en MIME-Version: 1.0 To: Antti Linno CC: pgsql-sql@postgresql.org Subject: Re: interval query. References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Archive-Number: 200101/478 X-Sequence-Number: 1154 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