o1.order_id,
SUM(o2.cost) AS 订单明细合计
FROM
`order` o1 JOIN order_details o2 ON (o1.order_id = o2.order_id)
GROUP BY
o1.order_id
HAVING
MAX(o1.subtotal) <>SUM(o2.cost)
SELECTsum(price),
sum(total * cost),
DATE_FORMAT(
FROM_UNIXTIME(time, '%Y-%m-%d') AS DATA
FROM
table_order t1,
table_orderlist t2
WHERE
t1.id = t2.order_id
GROUP BY
DATE_FORMAT(
FROM_UNIXTIME(time, '%Y-%m-%d')
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)