Am 23.10.2012 13:37, schrieb Kjell Rilbe:

> But your query still seems strange... Just trying to be helpful, so I 
> hope I'm not being a pain... :-)
...
> OK, but then why is R2 even 
> present in the subselect? 

To demonstrate an error in joins in subselects in FB3.0

> You can simplify your query like this:
> 
> select R1.RDB$RELATION_NAME
> from RDB$RELATION_FIELDS F1
> join RDB$RELATIONS R1
>      on F1.RDB$RELATION_NAME = R1.RDB$RELATION_NAME
> where F1.RDB$FIELD_NAME ='EMP_NO'
>      and not exists(
>          select 1
>          from RDB$RELATION_FIELDS F2
>          where F2.RDB$FIELD_NAME ='PHONE_EXT'
>              and F2.RDB$RELATION_NAME=R1.RDB$RELATION_NAME
>      );

Sure, but this query doesn't throw the error I wanted to demonstrate :-)

Frank
-- 
"Fascinating creatures, phoenixes, they can carry immensely heavy loads,
  their tears have healing powers and they make highly faithful pets."
      - J.K. Rowling

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_sfd2d_oct
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to