select 2019-02-20 dt concatdate_addnext_day2019-02-20MO-7_date_addnext_day2019-02-20MO-1 wk_dt countfrom select t1mid_id from select mid_id from dws_uv_detail_wk
The query selects the following columns:
- '2019-02-20' as dt: This column represents the date '2019-02-20'.
- concat(date_add(next_day('2019-02-20','MO'),-7),'_',date_add(next_day('2019-02-20','MO'),-1)) as wk_dt: This column represents the week range for the given date. It concatenates the start and end dates of the week, which is determined by subtracting 7 days from the next Monday.
- count(*): This column represents the count of records.
The query retrieves data from three different tables: dws_uv_detail_wk, dws_new_mid_day, and dws_uv_detail_wk. It performs several subqueries to filter the data based on specific conditions and join the results together. The final result is the count of records where the mid_id is not present in the dws_new_mid_day table for the given week range
原文地址: https://www.cveoy.top/t/topic/iD6J 著作权归作者所有。请勿转载和采集!