blasterstudios
Technical User
I have a query setup that pulls values from other tables based on their value in that referenced column. However 2 column values will come from the same table.
I use a table USERS that has reps and designers in it. I would like reference both in my query but I'm not sure how to discern from 2. Here's my query:
The problem occurs in my where, because on the 2nd line, it says fox_users.userid = fox_jobs.rep, but i also want it to pull the rows of fox_jobs.designer as well. I'm just not sure how to say, this is for the field rep, and this is for the field designer. Everything else works perfect.
I use a table USERS that has reps and designers in it. I would like reference both in my query but I'm not sure how to discern from 2. Here's my query:
Code:
SELECT
fox_clients.code AS code,
fox_jobs.jobid AS jobid,
fox_clients.name AS client,
fox_users.firstname AS rep,
fox_jobs.designer,
fox_jobs.duedate,
fox_status.status AS status,
fox_priorities.prioritylevel AS priority,
fox_types.type AS jobtype
FROM
fox_jobs,
fox_clients,
fox_users,
fox_status,
fox_priorities,
fox_types
WHERE
fox_clients.clientid = fox_jobs.client AND
fox_users.userid = fox_jobs.rep AND
fox_status.statusid = fox_jobs.status AND
fox_priorities.priorityid = fox_jobs.priority AND
fox_types.typeid = fox_jobs.jobtype
The problem occurs in my where, because on the 2nd line, it says fox_users.userid = fox_jobs.rep, but i also want it to pull the rows of fox_jobs.designer as well. I'm just not sure how to say, this is for the field rep, and this is for the field designer. Everything else works perfect.