How to join to an alias column in SQL Server? -
i have followig problem. when input empty want replace 'yellow_code' column aliased 'code'. when attempt inner join on aliased column 'code' 'grantcode' on table, following error description: "invalid column name 'code'".
anyways bypass this?
the select-column alias practically last thing applied statement , such not available joins "lower down" form part of query whole. can access alias if referenced outer select
e.g.
select my_code ( select 1 my_code .... ) x
Comments
Post a Comment