Between with a list of ranges possible ?

From: Arup Rakshit <aruprakshit(at)rocketmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Between with a list of ranges possible ?
Date: 2015-05-29 16:32:07
Message-ID: 3240662.p6P6L5YxOV@linux-wzza.aruprakshit
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

Can I do the below 3 queries in a single query ?

select * from table where number * 3 between start_value1 and end_value2;
select * from table where number * 3 between start_value2 and end_value2;
select * from table where number * 3 between start_value3 and end_value3;

--
================
Regards,
Arup Rakshit
================
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.

--Brian Kernighan

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Robert Haas 2015-05-29 16:43:34 Re: [HACKERS] Re: 9.4.1 -> 9.4.2 problem: could not access status of transaction 1
Previous Message Tomas Vondra 2015-05-29 16:20:26 Re: Planner cost adjustments