Subject Re: (Repost) Problem with SUM() on a computed column
Author joenyang
Hi,

> It is - provided you get the syntax right for correlating the two
> keys. The above ought to be:
> SELECT
> X.*,
> (SELECT SUM(Y.AMOUNT)
> FROM Y
> WHERE Y.CODE = X.CODE) AS TOTALAMOUNT
> FROM X
>
> InterBase will let you do ambiguous correlations like your
> example; Firebird will let you do it dialect 1 (it should give you
> a warning) but won't allow it in dialect 3. Just because you don't
> get a warning in IB doesn't mean that the ambiguity is OK.

Thanks a lot :)

Joeny