Newbie in need of serious help

Codes here !

Moderators: macek, egami, gesf

Post Reply
Elena Mitovska
New php-forum User
New php-forum User
Posts: 13
Joined: Tue Nov 12, 2002 12:11 pm
Location: Ukraine
Contact:

Post by Elena Mitovska » Sun Nov 17, 2002 11:02 pm

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 :)

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests