Possible Duplicate:
SQL – how to SELECT multiple tables and JOIN multiple rows from the same column?
I have three MySQL tables – language, category and property
/*
table `language`
`WHERE language.url='link'`*/
id | url
-----+-----
111 | link
/*
table `category`
`SELECT category.id, category.order`*/
id | order | group | type | location
-----+--------+-------+------+---------
111 | 3 | a42 | a81 | a63
/*
table `property`
`LEFT JOIN properties ON properties.id = category.group`*/
id | status
----+-------
a42 | public
a81 | update
a63 | states
and SQL
SELECT category.id, category.order, language.url, property.status AS `group`
FROM category
LEFT JOIN language
USING ( id )
LEFT JOIN property ON property.id = category.group
WHERE language.url='link'
LIMIT 1
that returns
id | order | url | group
----+-------+-------+-------
111 | 3 | link | public
SQL: How to return two more row data from table property so that result would be:
id | order | url | group | type | location
----+-------+-------+--------+--------+---------
111 | 3 | link | public | update | states
You will need 2 more
LEFT JOINs