On mytable no column is primary :
| Name | Company | Position |
|---|---|---|
| Michael | Tester | |
| Michael | Tester | |
| Michael | Tester | |
| Peter | Developer | |
| Peter | Developer | |
| Peter | Developer | |
| Peter | Developer |
What I want :
| Name | Company | Position |
|---|---|---|
| Michael | Tester | |
| Peter | Developer |
This does not work :
DELETE FROM
mytable
WHERE
Name NOT IN (
SELECT
MAX(Name)
FROM
mytable
GROUP BY
Company
)
;
Without new table creation and no CTE, how can I remove duplicate rows except one?