I'm having a brain freeze today.
I'm trying to find duplicate company records and insert the company record with the lowest ID number into another another.
select distinct (company), min(ID)as ID
into DistinctCompanies
from companies
group by company
What am I missing?
Thanks!
Rog