Missing Local ID: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
| Line 41: | Line 41: | ||
WHERE | WHERE | ||
hazardinfoversion.link_only = '0' AND | hazardinfoversion.link_only = '0' AND | ||
(hazardinfoversion.hazard_localid IS NULL | (hazardinfoversion.hazard_localid IS NULL OR | ||
hazard.hazard_localid IS NULL ) | hazard.hazard_localid IS NULL ) | ||
ORDER BY | ORDER BY | ||
| Line 60: | Line 60: | ||
ORDER BY | ORDER BY | ||
hazreduc.hazreduc_localid ASC | hazreduc.hazreduc_localid ASC | ||
</pre> | |||
'''Location''' | |||
<pre> | |||
SELECT | |||
locationinfoversion.location_localid, | |||
location.location_localid | |||
FROM | |||
locationinfoversion | |||
Inner Join location ON locationinfoversion.location_guid = location.location_guid | |||
WHERE | |||
(locationinfoversion.location_localid IS NULL OR | |||
location.location_localid IS NULL) AND | |||
locationinfoversion.link_only = '0' | |||
ORDER BY | |||
location.location_localid ASC | |||
</pre> | </pre> | ||
[[Category:NoPublic]] | [[Category:NoPublic]] | ||
[[Category:SQL Queries]] | [[Category:SQL Queries]] | ||
Revision as of 08:32, 12 February 2014
Field report
SELECT fieldreport.fieldreport_localid, fieldreport.dateofreport AS `Date of Information`, fieldreport.reportreceiveddate AS `Data Entry Date`, fieldreport.reportcompleteddate AS `Submitted Date`, fieldreport.reportverifieddate AS `Approved Date`, fieldreport.dataenterer AS `Data enterer`, fieldreport.verifiedby AS `Approved by` FROM fieldreport WHERE fieldreport.fieldreport_localid is null
Accident
SELECT accident.accident_localid, accidentinfoversion.accident_localid FROM accident Inner Join accidentinfoversion ON accident.accident_guid = accidentinfoversion.accident_guid WHERE (accident.accident_localid IS NULL OR accidentinfoversion.accident_localid IS NULL) AND accidentinfoversion.link_only = '0' ORDER BY accident.accident_localid ASC
Hazard
SELECT hazardinfoversion.hazard_localid, hazard.hazard_localid, hazardinfoversion.dataentrydate, hazardinfoversion.dataenterer FROM hazardinfoversion Inner Join hazard ON hazardinfoversion.hazard_guid = hazard.hazard_guid WHERE hazardinfoversion.link_only = '0' AND (hazardinfoversion.hazard_localid IS NULL OR hazard.hazard_localid IS NULL ) ORDER BY hazard.hazard_localid ASC
Hazard Reduction
SELECT hazreducinfoversion.hazreduc_localid, hazreduc.hazreduc_localid FROM hazreducinfoversion Inner Join hazreduc ON hazreducinfoversion.hazreduc_guid = hazreduc.hazreduc_guid WHERE (hazreducinfoversion.hazreduc_localid IS NULL OR hazreduc.hazreduc_localid IS NULL) AND hazreducinfoversion.link_only = '0' ORDER BY hazreduc.hazreduc_localid ASC
Location
SELECT locationinfoversion.location_localid, location.location_localid FROM locationinfoversion Inner Join location ON locationinfoversion.location_guid = location.location_guid WHERE (locationinfoversion.location_localid IS NULL OR location.location_localid IS NULL) AND locationinfoversion.link_only = '0' ORDER BY location.location_localid ASC