SQL Saved search Different Location
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
Accident and Victim
Hazard and HazRed
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