SUM(p.payable - p.single_price) AS profitCount,
m.order_id AS orderId,
m.create_time,
m.dept_airport_code,
m.arrv_airport_code,
m.payable AS price
FROM
om_passenger p,
om_order m
WHERE
p.order_id = m.order_id
AND p.ticket_status = ‘1‘
AND m.create_type = 3
AND m.order_status = ‘203‘
GROUP BY
p.order_id
ORDER BY
m.create_time DESC;
******************************************************************
SELECT
SUM(p.payable - p.single_price) AS profitCount,
m.order_id AS orderId,
m.create_time,
m.dept_airport_code,
m.arrv_airport_code,
m.payable AS price
FROM
om_passenger p,
(
SELECT
*
FROM
om_order t
WHERE
t.create_type = 3
AND t.order_status = ‘203‘
) AS m
WHERE
p.order_id = m.order_id
AND p.ticket_status = ‘1‘
GROUP BY
m.order_id
ORDER BY