I'm trying to add a compound primary key to a table I have called "Stock". Since there are duplicates in the primary key i desire, it won't allow me to do add the primary key, so is there a way to delete 1 of each duplicate in a single query instead of having to do it manually?
I've found all the duplicates using this query (67 total rows with duplicates):
SELECT Count(*), STK, yr, mn, dy
FROM Stock
GROUP BY STK, yr, mn, dy
HAVING count(*) > 1
ORDER BY STK ASC;