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

Popular posts from this blog

curl - PHP fsockopen help required -

HTTP/1.0 407 Proxy Authentication Required PHP -

c# - Resource not found error -