本文主要是介绍供应商对账语句,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
SELECT COUNT(*) ,订单号 FROM hehe GROUP BY 订单号 HAVING COUNT(*)>1;
(SELECT w.*,p.orderid AS 我们的订单号,p.fakuanjine AS 罚款金额,p.agencyfee AS 代办费,p.`overdueFine` AS 滞纳金1, p.statecode AS 状态码,p.total AS 我们收用户的钱,p.`total`-(w.代理价+w.`本金`+w.`滞纳金`) AS 利润 FROM hehe w LEFT JOIN paylist p ON w.订单号=p.`orderId` WHERE w.订单号 NOT IN ('376089','384513') ORDER BY p.statecode)
UNION ALL
(SELECT *,订单号 AS 我们的订单号,本金 AS 罚款金额,代理价 AS 代办费,滞纳金 AS 滞纳金1,7 AS 状态码,(代理价+`本金`+`滞纳金`)+2 AS 我们收用户的钱,2 AS 利润 FROM hehe WHERE 订单号 IN ('376089','384513') ORDER BY 订单号)
这篇关于供应商对账语句的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!