alajoie
asked on
SQL QUERY WITH INNER JOIN ON 3 TABLE
Hi, I need to find record on 3 tables.
Find all Record on TBL_Transaction depend on the NoStock of TBL_Car on Specified Date ( after dateout and before DateIn )
find NoStock, FirstName, LastName, Dateout, DateIn
TBL_Transaction
Field
IdTransaction CoutoisieId ClientID DateOut DateIn
3 2 1 2012-01-24 2012-01-25
4 3 2 2012-02-25 2012-01-26
TBL_Client
Field
IdClient LastName FirstName
1 hamel martin
2 hamel steve
TBL_Car
Field
IdCourtoisie NoStock Marque Model Annee
2 1081 toyota corolla 2012
3 1082 toyota matrix 2012
Find all Record on TBL_Transaction depend on the NoStock of TBL_Car on Specified Date ( after dateout and before DateIn )
find NoStock, FirstName, LastName, Dateout, DateIn
TBL_Transaction
Field
IdTransaction CoutoisieId ClientID DateOut DateIn
3 2 1 2012-01-24 2012-01-25
4 3 2 2012-02-25 2012-01-26
TBL_Client
Field
IdClient LastName FirstName
1 hamel martin
2 hamel steve
TBL_Car
Field
IdCourtoisie NoStock Marque Model Annee
2 1081 toyota corolla 2012
3 1082 toyota matrix 2012
Provide the expected result.
check code which might give expected result
nishant
SELECT t.*,c.LastName,c.FirstName,cr.NoStock,cr.Marque,cr.Model,cr.Annee FROM TBL_Transaction t,TBL_Client c,TBL_Car cr
WHERE c.ClientID=t.ClientID AND cr.IdCourtoisie=t.IdCourtoisie
Regards,nishant
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
The Awnser is more complete With Date and INNER JOIN parameters
Is clear that
CoutoisieId in tbl_transaction match with IdCourtoisie on table car but what about tbl_client