The given SQL query is incorrect. The ORDER BY clause should come after the WHERE clause. Here's the corrected query:

SELECT component_name, SUM(component_count) AS sum FROM abldba.t_component_count_year WHERE syn_time >= '2023-07-25 00:00:00' AND syn_time <= '2023-08-25 23:59:59' GROUP BY component_name ORDER BY sum DESC;

select component_namesum from select component_namesumcomponent_count as sum from abldbat_component_count_year GROUP BY component_name t ORDER BY sum DESC syn_time =2023-07-25 0000 and syn_time

原文地址: http://www.cveoy.top/t/topic/iOfT 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录