I’m working with a large database and I’m trying to delete data outliers. I found this code from a previous question and I modified it to work with my database.
DELETE FROM sv_condition_sw
WHERE snow_mountain > (select * from (SELECT AVG(snow_mountain)+1.5*STDDEV(snow_mountain)
FROM sv_condition_sw
WHERE lud='2012-11-28' ) x)
AND lud='2012-11-28'
It works great with one exception.
I have thousands of “lud”s or products in my case. How could I delete each lud (or product) with one query?