sql - Remove duplicates from MySQL table where 2 fields are the same -


so have table fields id (ai, primary key), ticker, pricedate, price.

i have bunch or records share same pricedate , ticker. there should 1 record per ticker given pricedate.

how go removing these duplicate records, given pricedate , ticker not unique fields?

delete your_table id not in  (   select *    (     select min(id)     your_table     group pricedate, ticker   ) x ) 

Comments

Popular posts from this blog

c# - Operator '==' incompatible with operand types 'Guid' and 'Guid' using DynamicExpression.ParseLambda<T, bool> -