Re: Need some sleep, 18c XE

From: Lothar Flatz <l.flatz_at_bluewin.ch>
Date: Thu, 10 Dec 2020 20:14:49 +0100
Message-ID: <8edc7e73-bf31-29e8-11a8-6f885f894e8d_at_bluewin.ch>



Hi Michael,

the subquery select f0.id from foo f0 where f0.id > 3; returns null. It seems in combination will the "all" operator that evaluates to true. I can not figure why.
Maybe "all" might be implemented asĀ  "not any <=".

select f1.id from foo f1 where f1.id > *any *(select f0.id from foo f0 where f0.id > f1.id) ;
also returns null, which looks correct to me.

Regards

Lothar

Am 10.12.2020 um 19:17 schrieb Michael D O'Shea/Woodward Informatics Ltd:
> Chaps, it has been a long day and I have been chasing a bug in ORM generated SQL all afternoon. I demo it minimally below using some contrived code.
>
> Do I just need some sleep? 3, really?
>
> Mike
> Woodward Informatics Ltd
>
>
> SQL>
> SQL>
> SQL> desc foo
> Name Null? Type
> ----------------------------------------- -------- ----------------------------
> ID NUMBER
>
> SQL> select * from foo;
>
> ID
> ----------
> 1
> 2
> 3
>
>
> SQL> select f1.id from foo f1 where f1.id > all (select f0.id from foo f0 where f0.id > f1.id);
>
> ID
> ----------
> 3
>
> SQL>
> SQL>
> SQL>
>
> --
> http://www.freelists.org/webpage/oracle-l
>
>

--
http://www.freelists.org/webpage/oracle-l
Received on Thu Dec 10 2020 - 20:14:49 CET

Original text of this message