mysql> select name,a.shop_id,max(a.rate) as b from shop,coupon as a where shop.s
hop_id=a.shop_id group by a.shop_id order by b desc limit 3;
+------+---------+------+
| name | shop_id | b    |
+------+---------+------+
| aa   | 1       | 120  |
| dd   | 4       | 100  |
| cc   | 3       | 94   |
+------+---------+------+
3 rows in set (0.01 sec)