pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
between syntax
4+ messages / 4 participants
[nested] [flat]

* between syntax
@ 2001-11-16 11:41 Markus Bertheau <twanger@bluetwanger.de>
  2001-11-16 15:43 ` Re: between syntax Tom Lane <tgl@sss.pgh.pa.us>
  2001-11-16 16:23 ` Re: between syntax Stephan Szabo <sszabo@megazone23.bigpanda.com>
  2001-11-16 16:38 ` Re: between syntax Peter Eisentraut <peter_e@gmx.net>
  0 siblings, 3 replies; 4+ messages in thread

From: Markus Bertheau @ 2001-11-16 11:41 UTC (permalink / raw)
  To: pgsql-sql

Good day,

shouldn't 

'between 1 and 7'

return the same results as

'between 7 and 1'

?

Markus Bertheau





^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: between syntax
  2001-11-16 11:41 between syntax Markus Bertheau <twanger@bluetwanger.de>
@ 2001-11-16 15:43 ` Tom Lane <tgl@sss.pgh.pa.us>
  2 siblings, 0 replies; 4+ messages in thread

From: Tom Lane @ 2001-11-16 15:43 UTC (permalink / raw)
  To: Markus Bertheau <twanger@bluetwanger.de>; +Cc: pgsql-sql

Markus Bertheau <twanger@bluetwanger.de> writes:
> shouldn't 
> 'between 1 and 7'
> return the same results as
> 'between 7 and 1'
> ?

Nope.  SQL92 section 8.3 defines BETWEEN thusly:

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

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: between syntax
  2001-11-16 11:41 between syntax Markus Bertheau <twanger@bluetwanger.de>
@ 2001-11-16 16:23 ` Stephan Szabo <sszabo@megazone23.bigpanda.com>
  2 siblings, 0 replies; 4+ messages in thread

From: Stephan Szabo @ 2001-11-16 16:23 UTC (permalink / raw)
  To: Markus Bertheau <twanger@bluetwanger.de>; +Cc: pgsql-sql

On 16 Nov 2001, Markus Bertheau wrote:

> Good day,
>
> shouldn't
>
> 'between 1 and 7'
>
> return the same results as
>
> 'between 7 and 1'

Don't think so, if I'm reading the spec correct, the conversion is:

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





^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: between syntax
  2001-11-16 11:41 between syntax Markus Bertheau <twanger@bluetwanger.de>
@ 2001-11-16 16:38 ` Peter Eisentraut <peter_e@gmx.net>
  2 siblings, 0 replies; 4+ messages in thread

From: Peter Eisentraut @ 2001-11-16 16:38 UTC (permalink / raw)
  To: Markus Bertheau <twanger@bluetwanger.de>; +Cc: pgsql-sql

Markus Bertheau writes:

> shouldn't
>
> 'between 1 and 7'
>
> return the same results as
>
> 'between 7 and 1'

This question might have been interesting 10 or 15 years ago when the SQL
standard was written, but today the answer is no.

What you're looking for is the syntax BETWEEN SYMMETRIC 1 AND 7, which is
new in SQL99 and not yet implemented in PostgreSQL.

-- 
Peter Eisentraut   peter_e@gmx.net




^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2001-11-16 16:38 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2001-11-16 11:41 between syntax Markus Bertheau <twanger@bluetwanger.de>
2001-11-16 15:43 ` Tom Lane <tgl@sss.pgh.pa.us>
2001-11-16 16:23 ` Stephan Szabo <sszabo@megazone23.bigpanda.com>
2001-11-16 16:38 ` Peter Eisentraut <peter_e@gmx.net>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox