SELECT vip, IFNULL(SUM(order_price),0) AS order_total FROM order_tb RIGHT JOIN uservip_tb USING (user_id) GROUP BY vip ORDER BY order_total DESC