Skip to content
Advertisement

mysql: Select Max value and delete other rows

I need to get the row with the maximum status value for each employee_id and keep only one record for employee_id

If status is equal for the same employee id then pick one and delete the other, Thank you and appreciated

Table:

ID Type Status emplyee_ID
1111 A 0 10
2222 A 1 10
3333 B 0 20
4444 B 0 20

Desired out but

ID Type Status Emplyee ID
2222 A 1 10
3333 B 0 20

Advertisement

Answer

try with this …

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement