Click here to Skip to main content
15,896,541 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,

I am a newbie for T-Sql, I came across a SP where multiple tables are engaged using multiple joins but the where clause contain a column field without any table reference and assigned for an incoming variable,like

where 'UserId = @UserId'

instead - no table reference like 'a.UserId = @Userid' ............ Can any please do refer to me any material that clears my mind regarding such issue................... help is appreciated.

Thank You.
Posted

if same column name exist in multiple tables you cant use column name directly. otherwise you can use.
 
Share this answer
 
You can use column name directly without using fullname of the column or aliastable name along with column name when only one column is existing in all the tables which are participating in the join . I have written few more such questions in sql interview questions and answers [^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900