Subject RE: [ib-support] Invalid Query or Bug ?
Author Leyne, Sean
Hans,

> Reduced to simplest form, I ran into a problem
>
> SELECT A,
> (SELECT Y.B FROM TABLE Y WHERE Y.B = X.A)
> FROM TABLE X
>
> Works fine .. but
>
> SELECT DISTINCT A,
> (SELECT Y.B FROM TABLE Y WHERE Y.B = X.A)
> FROM TABLE X

In both cases I would recommend using a join based syntax as in:

SELECT x.A, y.B
FROM TABLEX x
JOIN TABLEY y WHERE Y.B = X.A


Sean