我卡在这个问题: 大家好(不知道为什么它没有在第一行出现......)工作算术运算SQL SELECT
我有2个表:
-factures (invoices)
-commandes_clients (orders)
每个表格包含独特的id_client
。
我试图让和排序依据发票金额每个客户的平均订单金额(总金额的发票相同的客户端的订单,每个客户端/数字)
Client 1 Average order amount 1254.21
Client 2 Average order amount 951.88
Client 3 Average order amount 891.11
...
我想通过平均量进行排序,以获得客户帕尔马里斯
Table facture contains :
id_client, invoice_number, total amount
Table commandes_clients contains :
id_client
感谢您的帮助
嗨,欢迎来到SO。请参阅https://meta.stackoverflow.com/questions/333952/why-should-i-provide-an-mcve-for-what-seems-to-me-to-be-a-very-simple-sql-query – Strawberry