View Single Post
Old 06-03-2011, 01:21 AM   #2 (permalink)
tony
The Addict
 
tony's Avatar
 
Join Date: Aug 2008
Posts: 336
Thanks: 8
tony is on a distinguished road
Default

I don't seem to understand your problem, but I am guessing you want all the orders that have a staff_id that exists in the staffs table. If that is the case, you can do a left join:

SQL Code:
SELECT orders.staff_id
FROM orders
LEFT JOIN staffs ON orders.staff_id = staffs.staff_id
tony is offline  
Reply With Quote