I have 3 tables: SWPPP_SITE, SWPPP_TRACKING, and LKUP_CONSTRUCTION_STATUS.
The SWPPP_SITE is 1:many with SWPPP_TRACKING. The SWPPP_SITE is 1:1 with LKUP_CONSTRUCTION_STATUS.
I'm trying to select 1 record for a unique site for all sites. This query gives me multiple records for each site -- 1 site, many tracking, and the corresponding status.
How can I retrieve only e.g. one record for Test_1 and one for Test_site3, per the image?
SELECT s.OBJECTID As SITE_OID, s.Site_Name AS SITE_Site_Name,
s.Construction_StatusID, t.OBJECTID As TRACKING_OID, t.Site_Name As
TRACKING_Site_Name, cs.OBJECTID As CON_STAT_OID, cs.Status
FROM SWPPP_SITE s INNER JOIN SWPPP_TRACKING t ON s.Site_Name = t.Site_Name
INNER JOIN LKUP_CONSTRUCTION_STATUS cs ON s.Construction_StatusID =
cs.OBJECTID
WHERE t.Completion_Date Between '1/1/18' And '5/1/18';