Re: BETWEEN [SYMMETRIC | ASYMMETRIC]

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Robert B(dot) Easter" <reaster(at)comptechnews(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: BETWEEN [SYMMETRIC | ASYMMETRIC]
Date: 2001-01-09 23:58:15
Message-ID: 7784.979084695@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

"Robert B. Easter" <reaster(at)comptechnews(dot)com> writes:
> subselects=# SELECT 2 BETWEEN 3 AND 1;
> ?column?
> ----------
> f
> (1 row)

SQL92 quoth:

6) "X BETWEEN Y AND Z" is equivalent to "X>=Y AND X<=Z".

so this is correct behavior, even if it might seem surprising.

> Any chance of BETWEEN [SYMMETRIC | ASYMMETRIC] being implemented?

> SELECT 2 BETWEEN SYMMETRIC 3 AND 1;
> ?column?
> ----------
> t
> (1 row)

Build a function based on this idea:

regression-# select case
regression-# when 3 < 1 then 2 between 3 and 1
regression-# else 2 between 1 and 3
regression-# end;
case
------
t
(1 row)

I don't really see this as important enough to justify introducing a
nonstandard syntax for it...

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert B. Easter 2001-01-09 23:58:22 SIMILAR TO for regular expressions
Previous Message Lamar Owen 2001-01-09 23:11:11 Re: Re: Beta2 ... ?