Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Insert based on another table 1

Status
Not open for further replies.

Johnny42

Technical User
Jul 13, 2004
127
CA
Table1=tblAssMaterialSupplier(,refMaterial,Defaut)

Table2=tblSupplier(refSupplier,NomCompagnie)


Table3=tblMaterial(refMaterial,Material,Marque)

I would like to insert into table1 all records from table3 where
Table1.refMaterial =Table3.refMaterial
Table1.Defaut=1
Table1.refSupplier=selectTable2.NomCompagnie =Table3.Marque
 
Something like this ?
INSERT INTO tblAssMaterialSupplier (refSupplier, refMaterial, Defaut)
SELECT refSupplier, refMaterial, 1
FROM tblMaterial INNER JOIN tblSupplier ON Marque = NomCompagnie

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top