You are here: Left Join variable not valid « MsSQL Server « IT news, forums, messages
Left Join variable not valid

Posted by Sfj on 09/29/40 11:50

Hello folks,

Old programmer learning new tricks.

I think similar issues have been posted, but I would like to ask some help
with the following code...

select [t1.*],[t2.userid] as [userid2],[t2.approved],[t2.type]
from [tblMembers] as t1 left outer join [tblProfiles] as t2
on [t1.userid]=[t2.userid]
where ...

I get the following error...

[Microsoft][ODBC SQL Server Driver][SQL Server]Invalid column name
't1.userid'.

....but there is a [userid] in both tables. Do I have to make them keys or
something? And I need to do work (add and update) on both tables after the
values are returned.

Also, how bad is my syntax? If you could give advice on removing extraneous
brackets and I would like to not have to use the "as" clause. I really just
want to keep it simple. Whatever works though.

Thanks

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация