If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
chnge query for a join file
I need to change this query because I needed to add a join file
between company and car_owners. There is a many to many between cars and owners. This is for rental purposes. One car could have more than one owner_company and one owner could have more than one cars. So to get this same query with the join file, what do I do? Select car_o.car_id AS car_id, co.comp_name AS comp_name, car_o.start_date AS start_date,car_o.end_date AS end_date from (MyDatabase.CAR_OWNER car_o INNER JOIN MyDAtabase.COMPANY co) where (car_o.comp_id=co.comp_id); thanks, |
#2
|
|||
|
|||
chnge query for a join file
Try this --
SELECT car_o.car_id AS car_id, co.comp_name AS comp_name, car_o.start_date AS start_date, car_o.end_date AS end_date FROM CAR_OWNER AS car_o LEFT JOIN COMPANY AS co ON car_o.comp_id = co.comp_id; -- KARL DEWEY Build a little - Test a little "JRough" wrote: I need to change this query because I needed to add a join file between company and car_owners. There is a many to many between cars and owners. This is for rental purposes. One car could have more than one owner_company and one owner could have more than one cars. So to get this same query with the join file, what do I do? Select car_o.car_id AS car_id, co.comp_name AS comp_name, car_o.start_date AS start_date,car_o.end_date AS end_date from (MyDatabase.CAR_OWNER car_o INNER JOIN MyDAtabase.COMPANY co) where (car_o.comp_id=co.comp_id); thanks, |
Thread Tools | |
Display Modes | |
|
|