Trying to do a subquery to select the minimum price from table1, table what holds 15 million rows.
I think that my approach is not the most suitable way of doing this.
I want to select after oen_norm because oen_norm may have 1-10 rows per entry, but I need the smallest price for each oen_norm.
Could you please help on this one ?
I have indexes set up, but that doesnt seem to help for this particular query.
SELECT * FROM db.table1 as a WHERE a.quality IN (1,2,3) AND a.price = (SELECT MIN(price) FROM db.table1 WHERE oen_norm = a.oen_norm)