SQL Saved search Duplicate ID: Difference between revisions

From IMSMA Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
These queries finds duplicates on ID. They are added to V6.0 as Saved searches with a syntax that works as Saved search </br>
These queries finds duplicates on ID. They are added to V6.0 as Saved searches with a syntax that works as Saved search <br/>
'''Accident ID'''
'''Accident ID'''
<pre>
<pre>
Line 37: Line 37:
</pre>
</pre>
'''Location ID'''
'''Location ID'''
<pre>
SELECT
location.location_localid,
Count(location.location_guid)
FROM
location
GROUP BY
location.location_localid
HAVING
Count(location.location_guid) >  '1'
</pre>
'''MRE ID'''
<pre>
<pre>



Revision as of 06:08, 13 February 2014

These queries finds duplicates on ID. They are added to V6.0 as Saved searches with a syntax that works as Saved search
Accident ID

SELECT
accident.accident_localid,
Count(accident.accident_guid)
FROM
accident
GROUP BY
accident.accident_localid
HAVING
Count(accident.accident_guid) >  '1'

Hazard ID

SELECT
hazard.hazard_localid,
Count(hazard.hazard_guid)
FROM
hazard
GROUP BY
hazard.hazard_localid
HAVING
Count(hazard.hazard_guid) >  '1'

HazRed ID

SELECT
hazreduc.hazreduc_localid,
Count(hazreduc.hazreduc_guid)
FROM
hazreduc
GROUP BY
hazreduc.hazreduc_localid
HAVING
Count(hazreduc.hazreduc_guid) >  '1'

Location ID

SELECT
location.location_localid,
Count(location.location_guid)
FROM
location
GROUP BY
location.location_localid
HAVING
Count(location.location_guid) >  '1'

MRE ID