select datecreate_timecountidfrom select idrequest_paramsresponse_paramsJSON_EXTRACTresponse_params $message as fzcreate_timefrom cl_sms_logwhere datecreate_time = 2023-01-01a --过滤回填短信 where fz is no
The error in your query is because you are using a subquery without aliasing it. You need to provide an alias for the subquery.
Here's the corrected query:
SELECT DATE(create_time), COUNT(id)
FROM
(
SELECT
id, request_params, response_params, JSON_EXTRACT(response_params, '$.message') AS fz, create_time
FROM cl_sms_log
WHERE DATE(create_time) >= '2023-01-01'
) AS a -- alias for the subquery
WHERE fz IS NOT NULL
GROUP BY 1
原文地址: https://www.cveoy.top/t/topic/hMe1 著作权归作者所有。请勿转载和采集!