|
|
@@ -61,13 +61,13 @@
|
|
|
order by end_amount desc
|
|
|
) tb1
|
|
|
left join
|
|
|
- (select distinct moive_id, movie_name, movie_source from deepthink.all_moive union
|
|
|
- select series_id, ifnull(replace(series_name,REGEXP_SUBSTR(series_name, '[0-9]+$'),''),series_name),4 from media_api.kuaishou_drama_series_info) tb2 on tb1.movie_id=tb2.moive_id
|
|
|
+ (select distinct moive_id, REGEXP_REPLACE(movie_name, '[^a-zA-Z一-龥]', '') as movie_name, movie_source from deepthink.all_moive) tb2 on tb1.movie_id=tb2.moive_id
|
|
|
group by movie_name order by rk limit 10) ot1
|
|
|
left join
|
|
|
- (select ifnull(replace(product_name,REGEXP_SUBSTR(product_name, '[0-9]+$'),''),product_name) as product_name, round(ifnull(sum(cost_amount),0),2) as cost_amount, sum(real_cost_amount) as real_cost_amount
|
|
|
- from application.media_product_report_daily where stat_date=${date} group by ifnull(replace(product_name,REGEXP_SUBSTR(product_name, '[0-9]+$'),''),product_name)
|
|
|
+ (select REGEXP_REPLACE(product_name, '[^a-zA-Z一-龥]', '') as product_name, round(ifnull(sum(cost_amount),0),2) as cost_amount, sum(real_cost_amount) as real_cost_amount
|
|
|
+ from application.media_product_report_daily where stat_date=${date} group by REGEXP_REPLACE(product_name, '[^a-zA-Z一-龥]', '')
|
|
|
) ot2 on ot1.movie_name=ot2.product_name
|
|
|
+ group by case ot1.movie_source when 2 then movie_name else concat('欢瑞自制-', movie_name) end
|
|
|
order by rk
|
|
|
</select>
|
|
|
|