Add an additional Join to an existing query
Posted on 2008-06-19
Joins really aren't my strong point, so I'd be grateful of any pointers with this one.
This is my existing query;
SELECT m.ID, m.shortname, m.retailer_name, o.merchantid, o.id AS oid, o.offertitle, o.offerbody, o.a_status, o.offerauthor
FROM merchants m
LEFT JOIN hurry_offers o
ORDER BY oid DESC
I have a 3rd table called 'hurry_users', which I would like to join. The 'o.offerauthor' in the existing query returns the ID of a row which matches the row in hurry_users - what I would like to do is bring that back so instead of just returning the ID, I can return the actual username (in a field called 'username').
Hope that makes sense!