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

How to logout from a login page in asp.net -

Stack level too deep error after upgrade to rails 3.2 and ruby 1.9.3 -