Subject | Re: [firebird-support] Re: Trouble with BETWEEN operator |
---|---|
Author | Anderson Farias |
Post date | 2008-04-11T12:56:09Z |
> My concern is that people will come to grief if they misapply grouping andNo, theres no misunderstanding here (well, not from *my* part as far as I
> aggregation. The example shown by Anderson Farias illustrates one such
> misunderstanding:
can see).
the select into EXISTS will return 1 or nothing and do EXACTLY what Ain
wants. Theres nothing even conceptual wrong with it.
> SELECT r0.UID FROM TAB_A r0Have you tryed at all? It is pretty valid! It works fine and it's not a FB
> WHERE EXISTS (SELECT 1 FROM TAB_B WHERE
> r0.UID = AID having COUNT(1) BETWEEN 1 AND 10)
>
> which is not valid,
*bug* for sure!
One could have changed the select inside EXISTS to
SELECT COUNT(1), 1 FROM TAB_B WHERE r0.UID = AID
having COUNT(1) BETWEEN 1 AND 10
Constants on select expressions do not have to be "grouped by"
> it would always terminate and return true if at least one match were madeWhat's wrong with that? One use EXISTS with this in mind right?
> and would
> not ever reach the point of returning either true or false if there were
> more than 10
> matches.
> The engine *should* return an "expression evaluation not supported" onI don't think so (and neither FB does)
> this
> predicate.
Regards,
Anderson Farias