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.
Author |
Topic |
deanglen
Yak Posting Veteran
65 Posts |
Posted - 2013-03-28 : 08:08:27
|
Hi I am trying to join two SQl tables to find all customers from the USAThe two tables are Customer and Address are joined by CustomerIDI tried something like this but get errors. Any idea?Select FirstName,LastName,Email,IsRegistered,OkToEmail FROM CustomerLEFT JOIN AddressOn Customer.CustomerID=Address.CustomerIDWHERE Country='USA' |
|
James K
Master Smack Fu Yak Hacker
3873 Posts |
Posted - 2013-03-28 : 08:23:38
|
What kind of errors did you get? Post the exact text. Although not related to the error you are getting, if the Country column is in the Address table, you could use INNER JOIN instead of LEFT JOIN. Even if you use left join, it turns out to be an inner join because of the WHERE clause. |
|
|
|
|
|