Den 2012-10-23 10:32 skrev Frank såhär:
> 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 R2.RDB$RELATION_NAME
>                        from RDB$RELATION_FIELDS F2
>        join RDB$RELATIONS R2 on F2.RDB$RELATION_NAME=R1.RDB$RELATION_NAME
>                        where F2.RDB$FIELD_NAME ='PHONE_EXT'));
Although I can't see why it would give the indicated error, the query 
seems utterly pointless. R2 and F2 are not correlated and so the 
subquery will return all F2 records paired with all R2 records. I think 
it's a typo and that the subquery's join condition should refer to R2, 
not R1.

Kjell

-- 
--------------------------------------
Kjell Rilbe
DataDIA AB
E-post: kj...@datadia.se
Telefon: 08-761 06 55
Mobil: 0733-44 24 64



------------------------------------------------------------------------------
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