mysql版本5.7.12
查询
SELECT JSON_OBJECT(unix_timestamp(created_time),JSON_OBJECT(status,cast(concat(count(status))as char))) FROM table_name where status='NEW' and unix_timestamp(created_time) between 1512543400 and 1532716199 GROUP BY unix_timestamp(created_time);
结果
+--------------------------------------------------------------------------------------------------+
| JSON_OBJECT(unix_timestamp(created_time),JSON_OBJECT(status,cast(concat(count(status))as char))) |
+--------------------------------------------------------------------------------------------------+
| {"1526447587": {"NEW": "1"}} |
| {"1530170666": {"NEW": "1"}} |
+--------------------------------------------------------------------------------------------------+
我想像下面这样取消引用值“1”,怎么做??
{"1526447587": {"NEW": 1}}
1条答案
按热度按时间oxiaedzo1#
把石膏取下来
char
:这将输出:
演示