Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 10 of 10 total
Thread BETWEEN
Thu, Jun 4 2009 9:46 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

May be WAD may be bug. I suddenly thought is BETWEEN between or between and including (amazing what goes through your mind isn't it) so I ran a test.

I also thought I'd test something else out. This

select _ID from contacts where _ID between 10 and 100001

produces a 1 row result

whereas this

select _ID from contacts where _ID between 100001 and 10

returns a null row.

The manual doesn't say the parameters have to be in ascending order, and whilst it may be required I don't understand why that would be so.

Roy Lambert
Thu, Jun 4 2009 10:37 AMPermanent Link

Fernando Dias

Team Elevate Team Elevate

Roy,

It's the standard definition for the "between" predicate.
Here is an excerpt of the relevant part in the SQL2003 standard docs:

-----------------------------------------------------------------------
1) If neither SYMMETRIC nor ASYMMETRIC is specified, then ASYMMETRIC is implicit.

(...)

6) “X BETWEEN ASYMMETRIC Y AND Z” is equivalent to “X>=Y AND X<=Z”.
-----------------------------------------------------------------------


--
Fernando Dias
[Team Elevate]
Thu, Jun 4 2009 11:05 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Fernando


OK so what's

X BETWEEN SYMMETRIC Y AND Z

Roy Lambert
Thu, Jun 4 2009 12:38 PMPermanent Link

Fernando Dias

Team Elevate Team Elevate

Roy,

X BETWEEN SYMMETRIC Y AND Z is equivalent to (X>=Y AND X<=Z) OR (X>=Z AND X<=Y).

IOW, it's a short way to say:
X BETWEEN Y AND Z OR X BETWEEN Z AND Y

But AFAIK it's not implemented in EDB.

--
Fernando Dias
[Team Elevate]
Thu, Jun 4 2009 1:12 PMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Fernando


So SYMMETRIC sounds as though it means what almost any human being would translate BETWEEN to mean. Yet again I am astounded by the imbecility of the standard setters.

Roy Lambert
Thu, Jun 4 2009 1:40 PMPermanent Link

Fernando Dias

Team Elevate Team Elevate

Roy,

> So SYMMETRIC sounds as though it means what almost any human being would translate BETWEEN to mean. Yet again I am astounded by the imbecility of the standard setters.

Ok, but don't kill the messenger, please Smiley

--
Fernando Dias
[Team Elevate]
Thu, Jun 4 2009 1:50 PMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Fernando

>Ok, but don't kill the messenger, please Smiley

Don't worry. I prefer to keep them alive so I can keep on torturing them.

Roy Lambert
Fri, Jun 5 2009 12:06 PMPermanent Link

"John Hay"
Roy

So SYMMETRIC sounds as though it means what almost any human being would
translate BETWEEN to mean. Yet again I am astounded by the imbecility of the
standard setters.

So "the days between Monday and Thursday" is the same as "the days between
Thursday and Monday" ? <bg>

John

Sat, Jun 6 2009 3:43 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

John

> So SYMMETRIC sounds as though it means what almost any human being would
>translate BETWEEN to mean. Yet again I am astounded by the imbecility of the
>standard setters.
>
>So "the days between Monday and Thursday" is the same as "the days between
>Thursday and Monday" ? <bg>

Yes and No Smiley

The days between Monday 1st and Thursday 4th are the same as the days between Thursday 4th and Monday 1st but not the same as the days between Thursday 4th and Monday 8th.

I brilliant example of partial definition of the parameters.

Roy Lambert
Mon, Jun 8 2009 5:52 AMPermanent Link

"John Hay"
Roy
> Yes and No Smiley
>
> The days between Monday 1st and Thursday 4th are the same as the days
between Thursday 4th and Monday 1st but not the same as the days between
Thursday 4th and Monday 8th.
>
> I brilliant example of partial definition of the parameters.

With you on their case the standard setters are between a rock and a hard
place or was that between.....

John

Image