sql - Grab all IDs except for Min Value -


i trying other keylocationids numberofduplicates. want exclude min(keylocationid) , want list of others.

select companyid, location, eventcode, count(*) numberofduplicates, min(keylocationid) keepthisone trip.keylocations group companyid, location, eventcode having count (*) > 1 order location asc 

select companyid, location, eventcode, count() numberofduplicates trip.keylocations keylocationid not in (select min(keylocationid) trip.keylocations group companyid, location, eventcode) group companyid, location, eventcode having count () > 1 order location asc


Comments

Popular posts from this blog

javascript - Create a stacked percentage column -

Optimising Firebase database by automatically overwriting data -

javascript - Angular UI-Grid customTemplate directive causing rows to load slowly/? -