Monday, September 6, 2010

Join Three Table

How to join three table
SELECT e.emp_name, d.DeptName
FROM Emp e INNER JOIN DeptName d
ON e.emp_id = d.emp_id JOIN Sal s
ON d.dept_id = s.dept_id


SELECT a.au_lname, a.au_fname, t.title
FROM authors a INNER JOIN titleauthor ta
ON a.au_id = ta.au_id JOIN titles t
ON ta.title_id = t.title_id

select
r.recipe_name,
i.ingredients_list,
p.products_list
from
recipes r,
ingredients i,
products p
where
r.RecipeID = i.IngreRecipeID and
i.IngreProductID = p.ProductID
;

0 comments:

Post a Comment