Combine and delete duplicate records in table with PSQL -


i have table of contacts:

key |first | last |   dept    | ... 1    mary    null    english 2    john    fisher  math 3    mary    jones   null 

how can combine separate records 1 , delete duplicates? this:

key |first | last |   dept    | ... 1    mary    jones   english 2    john    fisher  math 

i know how find duplicates using:

select first, last, dept names group first, last, dept having count(*) > 1 order first, last; 

but combining turning bit of challenge