SQL Saved search No links

From IMSMA Wiki
Revision as of 08:01, 13 February 2014 by Alnaucler (talk | contribs) (Created page with "These queries finds records that do not have links which might not be a data quality issue depending on the business rules in your country. They are added to V6.0 as Saved sea...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

These queries finds records that do not have links which might not be a data quality issue depending on the business rules in your country. They are added to V6.0 as Saved searches with a syntax that works as Saved search
Accidents without link to Victim

SELECT DISTINCT
accident_localid 
FROM
accident 
WHERE accident.accident_guid NOT IN (
SELECT DISTINCT
accident.accident_guid
FROM
link
Inner Join accident ON accident.accident_guid = link.from_guid
WHERE
link.to_link_type =  'Victim')
ORDER BY
accident_localid