msmith29063
03-12-2007, 05:37 PM
Sorry, guys. I'm stumped. I've tried various MySQL JOINS to no avail. I need to be able to only return records from one table that have records associated with it in another table.
The existing query is:
SELECT * FROM intranet_dept ORDER BY deptOrder
But, I only want to display records IF the other table references them. The other existing query is:
SELECT * FROM intranet_deptfaq WHERE deptfaqDept=deptID ORDER BY deptfaqOrder
deptID is the ID from the first query. I just want to display records from intranet_dept if there are any records in intranet_deptfaq where deptfaqDept = deptID. Thanks for any help!
The existing query is:
SELECT * FROM intranet_dept ORDER BY deptOrder
But, I only want to display records IF the other table references them. The other existing query is:
SELECT * FROM intranet_deptfaq WHERE deptfaqDept=deptID ORDER BY deptfaqOrder
deptID is the ID from the first query. I just want to display records from intranet_dept if there are any records in intranet_deptfaq where deptfaqDept = deptID. Thanks for any help!