Hello,
I'm trying to select two fields from table A that are both linked to table B. I'd like to do this in one statement, but I'm not sure how to. Here are the simplified table structures and sql.
I'm using MySQL.
warranty
warranty_id
warranty
jobs
job_id
man_warranty_id
ky_warranty_id
SELECT w.warranty AS ky_warranty, w.warranty AS man_warranty FROM warranty w, jobs j WHERE j.ky_warranty_id = w.warranty_id AND j.man_warranty_id = w.warranty_id AND job_id=10;
This sql doesn't work, it returns an empty set. What am I doing wrong? Can this be done in one statement?
I had the idea of nesting statements, however, in the real code I'm joining over 7 tables and nesting would complicate the code so much, it isn't worth it. Please help.
-Samantha