JSON_EXTRACT SUM函数

时间:2019-11-27 06:00:34

标签: mysql json database mariadb

这是我的存储数据。我需要“总计”的总和。基本上,我需要获取整体销售额。

enter image description here

这是我的查询,该查询返回0。

USE pharmacy_db;

SELECT SUM(JSON_EXTRACT(Invoice, "$[*].total")) AS sales
FROM sales;

enter image description here

0 个答案:

没有答案