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
I know this is old post, but recently I tested a solution and want to share if any one can find my solution helpful -
CREATE TABLE
tmpTable
LIKEyourTable
; insert intotmpTable
(col1
,col2
...colN
) SELECT distinctcol1
,col2
...colN
FROMyourTable
WHERE 1; drop tableyourTable
; RENAME TABLEtmpTable
TOyourTable
;
Please note, insert into statement may execute without primary key.
Thanks.