Delete the second record where a user has two records
Solution


Create a TempTable(record_table_keep) with minimum id for every subid,catid combination
Perform a DELETE JOIN between record_table and record_table_keep using LEFT JOIN
Only delete records from record_table whose id is not in record_table_keep


Proposed Query

CREATE TABLE record_table_keep
SELECT id,subid,catid FROM record_table WHERE 0=1;
ALTER TABLE record_table_keep ADD PRIMARY KEY (id);
INSERT INTO record_table_keep (id,subid,catid)
SELECT MIN(id) id,subid,catid FROM record_table GROUP BY subid,catid;
DELETE A.* FROM record_table A
LEFT JOIN record_table_keep B USING (id)
WHERE B.id IS NULL;
DROP TABLE record_table_keep;


Give it a Try !!!