SQL Saved search MA quality

From IMSMA Wiki
Revision as of 08:59, 13 February 2014 by Alnaucler (talk | contribs) (Created page with "These queries depends on the business rules in the country. More queries than the ones below are added to V6.0 as Saved searches with a syntax that works as Saved search <br /...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

These queries depends on the business rules in the country. More queries than the ones below are added to V6.0 as Saved searches with a syntax that works as Saved search
CR without polygon/polyline

SELECT hazreduc.hazreduc_localid
FROM hazreduc Inner Join imsmaenum ON hazreduc.hazreductypeenum_guid = imsmaenum.imsmaenum_guid 
WHERE imsmaenum.enumvalue =  'CompletionReport' AND 
( hazreduc.hasgeodata = FALSE OR hazreduc.hazreduc_guid NOT IN 
(SELECT DISTINCT hazreduc.hazreduc_guid 
FROM hazreduc Inner Join hazreduc_has_geospatialinfo ON hazreduc.hazreduc_guid = hazreduc_has_geospatialinfo.hazreduc_guid 
Inner Join geospatialinfo ON hazreduc_has_geospatialinfo.geospatialinfo_guid = geospatialinfo.geospatialinfo_guid 
Inner Join imsmaenum ON geospatialinfo.shapeenum_guid = imsmaenum.imsmaenum_guid 
WHERE imsmaenum.enumvalue  LIKE  'Poly%'))
ORDER BY
hazreduc.hazreduc_localid