mysql - Efficient way to find maximum value on 80+ tables -
i have 80 tables , want filter has highest price among 80 tables. plan on using query:
select id (select id, price t1 price = (select max(price) t1) union select id, price t2 price = (select max(price) t2) union select id, price t3 price = (select max(price) t3) ) m order price desc limit 1
but find inefficient. there other way? in advanced
i think lot faster.
select id, price t1 union select id, price t2 union select id, price t3 order price desc limit 1
wiki
Comments
Post a Comment