Casey Allen Shobe <cshobe(at)secureworks(dot)net> writes:
> In the following statement (which works), if I s/ps."usesysid"/"UID"/ in the
> two innermost subselects (such that it refers to the declared alias rather
> than the true column name), it fails. In DB2, it works in similar
> situations.
I find that hard to believe. If true, DB2 is broken. An output-column
alias should not be visible in expressions for other output columns.
There are obvious circularity problems with allowing such a thing.
regards, tom lane