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 |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2005-11-01 : 07:44:51
|
| tricia writes "Hi, I'm using this query to join data from 3 tables:select customers.customerid, customers.country, orders.orderid, orders.orderdate, orderdetails.unitpricefrom customers join customers on orders.orderid = orderdetails.orderidwhere country <> 'usa'and orderdate > '11/1/4'and I get this error message:Tables or functions 'customers' and 'customers' have the same exposed names. Use correlation names to distinguish them.I'm stuck on what to do next. Any help would be appreciated." |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2005-11-01 : 07:46:16
|
there's no orders table in your queryGo with the flow & have fun! Else fight the flow |
 |
|
|
Kristen
Test
22859 Posts |
Posted - 2005-11-01 : 07:59:40
|
Or any orderdetails table!from customersjoin customers on orders.orderid = orderdetails.orderid Kristen |
 |
|
|
PlaniB
Starting Member
4 Posts |
Posted - 2005-11-01 : 08:17:52
|
| select customers.customerid, customers.country, orders.orderid, orders.orderdate, [order details].unitpricefrom customers inner join orders on customers.customerid=orders.customeridinner join [order details] on orders.orderid=[order details].orderidwhere customers.country <> 'usa' and orders.orderdate > '1996-08-01 00:00:00.000'This going to work. Test it and see if you want this kind of result. |
 |
|
|
|
|
|