Changes

SQL Saved search Different Location

730 bytes added, 09:26, 13 February 2014
Created page with "These queries finds records where the assigned locations is not the same. They are added to V6.0 as Saved searches with a syntax that works as Saved search <br /> '''Accident ..."
These queries finds records where the assigned locations is not the same. They are added to V6.0 as Saved searches with a syntax that works as Saved search <br />
'''Accident and Victim'''
<pre>

</pre>
'''Hazard and HazRed'''
<pre>
SELECT DISTINCT
hazard_localid
FROM
hazard
Inner Join link ON hazard.hazard_guid = link.from_guid
Inner Join hazreduc ON link.to_guid = hazreduc.hazreduc_guid
Inner Join location AS HazLoc ON hazard.location_guid = HazLoc.location_guid
Inner Join location AS HazRedLoc ON hazreduc.location_guid = HazRedLoc.location_guid
WHERE
link.from_link_type = 'Hazard'
AND (HazLoc.location_guid <> HazRedLoc.location_guid)
ORDER BY
hazard_localid
</pre>





[[Category:NoPublic]]
[[Category:SQL Queries]]
6,632
edits