Newbie in need of serious help

  • Thread starter Thread starter Anonymous
  • Start date Start date
A

Anonymous

Guest
To retrive data from 2 table by one select query you eed to use LEFT OUTER JOIN or INNER JOIN constractuins of MySQL.
If every record in yuor Product table has its match in Supplier table use INNER JOIN, if it doesn't use LEFT OUTER JOIN. INNER JOIN fetches only those records that has its math in other table (matched by SupID)
For example, this quiery retrives information about both Product and Supplier from both tables:

Select distinct P.*, S.* from Products P LEFT OUTER JOIN Supplier S ON P.SupID=S.SupID WHERE P.SupID=......

Hope it helps :)
 
Back
Top