How to remove duplicates from table using SQL query

后端 未结 7 1641
遇见更好的自我
遇见更好的自我 2020-12-17 04:34

I have a table which is as follows:

emp_name   emp_address  sex  matial_status  
uuuu       eee          m    s
iiii       iii          f    s
uuuu       eee         


        
7条回答
  •  渐次进展
    2020-12-17 05:36

    one way

    select emp_name,   emp_address,  sex,  max(marital_status) as marital_status
    from Yourtable
    group by emp_name,   emp_address,  sex
    

    Since I don't know what you want, I used max for the marital status

    See also Including an Aggregated Column's Related Values for more examples

提交回复
热议问题