![]() |
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
![]() |

|
| Programming Error ! Programming error messages |
![]() |
|
SQL query to join three tables
|
LinkBack | Thread Tools | Display Modes |
|
|
#1 (permalink) |
|
Administrator
Posts: 18,702
Join Date: Jan 2006
Rep Power: 10
IM:
|
Customer_Details, EMAS and work_orders My current query SELECT * from (Customer_Details left join EMAS on Customer_Details.street_name = EMAS.street_name ) left join work_orders on Customer_Details.ID = work_orders.customer_ID where Proceed_Retrofit = 'yes' gives me dozens of nearly identical records in response which don't exist. What I want to see is the three relevent records (where Proceed_Retrofit = 'yes') from Customer_details and the associated data from the other tables. |
|
|
|
|
|
|
|
|
#2 (permalink) |
|
Administrator
Posts: 18,702
Join Date: Jan 2006
Rep Power: 10
IM:
|
from Customer_Details Left Outer join EMAS on Customer_Details.street_name = EMAS.street_name Left Outer join work_orders on Customer_Details.ID = work_orders.customer_ID where Proceed_Retrofit = 'yes' what is street name? i gues this is where the "duplicates" arise... do you not have a proper key to this table..? |
|
|
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|