Delete dupes using column alias

this works:

DELETE t1 FROM obssum_history  t1
INNER JOIN obssum_history  t2 
WHERE 
    t1.id < t2.id AND 
    t1.table_key = t2.table_key

if table_key was an alias instead of a column how would I do that?
with something added like this?
USING CONCAT(col1,col2) AS table_key

WHERE t1.id < t2.id 
  AND CONCAT(t1.col1,t1.col2) = CONCAT(t2.col1,t2.col2)
1 Like

Very cool!

It’s always a pleasure to receive your help!

niche

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.