1. SELECT
    2. *,SUM(a.order_price) as totalPrice,COUNT(a.id) as orderNum
    3. FROM
    4. consult b
    5. LEFT JOIN orderinfo a on a.consult_id = b.id
    6. WHERE
    7. a.create_time >='2022-02-28' AND
    8. a.create_time <='2022-02-29'
    9. GROUP BY b.id
    10. ORDER BY totalPrice ASC

    image.png
    image.pngimage.png