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

service - Android MediaPlayer calls onCompletion before it already finished -

javascript - Training Neural Network to play flappy bird with genetic algorithm - Why can't it learn? -

javascript - Create a stacked percentage column -