Subject | Re: subquery field in where phrase |
---|---|
Author | tailuo2002 |
Post date | 2008-04-20T12:50:29Z |
--- In firebird-support@yahoogroups.com, "unordained"
<unordained_00@...> wrote:
before.
<unordained_00@...> wrote:
>from tb a where (select count
> >> select a.*, (select count(*) from a1 where a1.b_id = b.id) as F1
> (*) from a1 where a1.b_id = b.id) = 100; [Alan]from tb a) z
>
> or if you're using FB2, something like:
>
> select z.* from
> (select a.*, (select count(*) from a1 where a1.b_id = b.id) as F1
> where z.F1 = 100;as F1 from tb a)
>
> or if you're using FB2.1, you could also try:
>
> with z (select a.*, (select count(*) from a1 where a1.b_id = b.id)
> select z.* from z where z.F1 = 100;these options? (incl. Alan's?)
>
> As far as I know, there's no performance difference between any of
>Thank you very much, that's great. I didn't know about table alias
> - Philip
>
before.