G
Guest
I have 2 tables that I'm trying to query to get an updated result. I don't
want to have duplicate job #'s yet I want the most current job #'s to join
with all the other info listed in MASTER_JCM_JOB_1 table. Do I need to just
do a select distinct on the job#'s and if so, how exactly?
How do I do this correctly? Thanks! Here is my SQL so far-
--------------------------------------------------------------------------------
SELECT DISTINCT MASTER_JCM_JOB_1.Job, MASTER_JCM_JOB_1.Description,
MASTER_JCM_JOB_1.Address_1, MASTER_JCM_JOB_1.Address_2,
MASTER_JCM_JOB_1.City, MASTER_JCM_JOB_1.State, MASTER_JCM_JOB_1.ZIP_Code,
MASTER_JCM_JOB_1.Site_Phone, MASTER_JCM_JOB_1.Fax_Phone,
MASTER_JCM_JOB_1.Supt_Pager, MASTER_JCM_JOB_1.Project_Manager,
MASTER_JCM_JOB_1.Superintendent, MASTER_JCM_JOB_1.StatusFROM MASTER_JCM_JOB_1
LEFT JOIN Current_Supers_Jobs ON MASTER_JCM_JOB_1.Job =
Current_Supers_Jobs.JobWHERE (((MASTER_JCM_JOB_1.Status)<>"Closed"))ORDER BY
MASTER_JCM_JOB_1.Job;
want to have duplicate job #'s yet I want the most current job #'s to join
with all the other info listed in MASTER_JCM_JOB_1 table. Do I need to just
do a select distinct on the job#'s and if so, how exactly?
How do I do this correctly? Thanks! Here is my SQL so far-
--------------------------------------------------------------------------------
SELECT DISTINCT MASTER_JCM_JOB_1.Job, MASTER_JCM_JOB_1.Description,
MASTER_JCM_JOB_1.Address_1, MASTER_JCM_JOB_1.Address_2,
MASTER_JCM_JOB_1.City, MASTER_JCM_JOB_1.State, MASTER_JCM_JOB_1.ZIP_Code,
MASTER_JCM_JOB_1.Site_Phone, MASTER_JCM_JOB_1.Fax_Phone,
MASTER_JCM_JOB_1.Supt_Pager, MASTER_JCM_JOB_1.Project_Manager,
MASTER_JCM_JOB_1.Superintendent, MASTER_JCM_JOB_1.StatusFROM MASTER_JCM_JOB_1
LEFT JOIN Current_Supers_Jobs ON MASTER_JCM_JOB_1.Job =
Current_Supers_Jobs.JobWHERE (((MASTER_JCM_JOB_1.Status)<>"Closed"))ORDER BY
MASTER_JCM_JOB_1.Job;