查询以获取“ prix_total” SQLITE的每月3
我有一个具有以下属性的表,“ id_commande,id_client,id_agent,d_commande,heure_commande,prix_total”。 D_Commande代表销售日期 prix_total表示销售的价格。
我尝试创建一个查询时每月获得“ prix_total”。我挣扎。 请注意,我尝试了此查询,但我没有得到正确的结果:
SELECT sum(prix_total)
FROM commande
GROUP BY (
SELECT strftime('%y','D_commande')
)
I have a table with the following attributes, "id_commande, id_client, id_agent, D_commande, Heure_commande, prix_total".
D_commande represents DATE OF SALE
prix_total represents the price of a sale.
when I tried to create a Query to Get the "prix_total" per month. I struggled.
notice that I tried this query but I don't get the correct result:
SELECT sum(prix_total)
FROM commande
GROUP BY (
SELECT strftime('%y','D_commande')
)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以使用
几个月来将结果划分
You can use
in order to get the result partitioned by months
”
Here is a demo
And also you can order by year and month: