ClickHouse SQL: Exclude Data with Commas in Reportid Column
SELECT toStartOfDay(toDateTime(Ds)) AS datetime_day_Ds, count(DISTINCT Reportid) AS Reportid_0 FROM log_iMonkey_Wechat_overview WHERE Ds >= toDateTime(#day_wechat_task_num_time.start#) AND Ds <= toDateTime(#day_wechat_task_num_time.end#) AND Debug = 1 AND PlatformType != 0 AND indexOf(Reportid, ',') = -1 GROUP BY datetime_day_Ds ORDER BY datetime_day_Ds DESC LIMIT 5000; This ClickHouse SQL query demonstrates how to filter data by excluding entries where the Reportid column contains a comma. Using the indexOf() function in conjunction with a WHERE clause condition, the query effectively eliminates data that does not meet the specified criteria, resulting in a refined data set for analysis or further processing. This method provides a practical solution for data manipulation and cleansing within the ClickHouse database environment.
原文地址: https://www.cveoy.top/t/topic/pL7e 著作权归作者所有。请勿转载和采集!