sql - Remove Duplicates leaving one record -


this question has answer here:

i have table namely orders has multiple duplicate records following:

id  1   2   3   b 4   c 5   

in above case, need duplicate titles , leave 1 only.

article b , article c fine. need remove articles a, except one.

sample output should this

id  1   3   b 4   c 

can me achieve this. have delete duplicate rows table

you can achieve using first, combined group by. this:

select first(table1.id) firstofid, table1.so table1 group table1.so order table1.so; 

Comments

Popular posts from this blog

matlab - Deleting rows with specific rules -

php - MySQLi multi_query results for later use -