Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Join zipcode column in #Order with tZipcode

Author  Topic 

Sun Foster
Aged Yak Warrior

515 Posts

Posted - 2009-11-03 : 16:20:21
How to join one temp table #Order with one existing table tZipcode.
I need to get [city name] in tZipcode from [zipcode] in #Order

Lamprey
Master Smack Fu Yak Hacker

4614 Posts

Posted - 2009-11-03 : 16:41:42
can you not just join on zipcode?
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2009-11-03 : 16:42:09
A join is the same even if it's to a temp table.

SELECT *
FROM Table1 t1
JOIN #temp t
ON t1.Column = t.Column1
WHERE ...

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog

"Let's begin with the premise that everything you've done up until this point is wrong."
Go to Top of Page
   

- Advertisement -