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
Post a Comment