I have a multi-table query that I want to retrieve certain results for. I need to retrieve all of this information for specific ID's. My query is valid in that results are returned, but it is flawed as any and all matches are returned.
Here is an example:
SELECT DISTINCT t1.first, t1.last, t1.street, t2.category, t3.specialty FROM t1, t2, t3 WHERE t1.ID=1 OR t1.ID=2 OR t1.ID=4 AND t1.catID=t2.catID AND t1.specialtyID=t3.specialtyID
I need these values (t1.first, t1.last, t1.street, t2.category, t3.specialty) for each t1.ID listed. Is it possible to do this in 1 query?