码迷,mamicode.com
首页 > 其他好文 > 详细

presto 查询每天固定时间段

时间:2020-01-13 14:30:59      阅读:205      评论:0      收藏:0      [点我收藏+]

标签:har   查询   ted   res   for   select   class   cas   and   

select task_id,state,createymd,from_unixtime(createtime) "创建时间",manager_name,open_state,hosted_amount,hosted_date,hosted_time,hosted,
    is_deal,deal_amout,order_mode,order_stype,order_id,manager_id,from_unixtime(close_time) "关闭时间"
    from hive.bdc_dwd.dw_fact_task_new_ss_daily 
    where acct_time=format_datetime(date_add(day,-1,current_timestamp),yyyy-MM-dd)
    and order_mode not in (2,3,6,7) 
    and par_order_id = 0 
    and (from_cid in (149,192,199,121,126,127,130,197,191,198) or category1id in (4782,5892))
    and category1id not in(4,9,21,448,2107,5787,5857,5788,4788,4791,3064)
    and cast(from_unixtime(createtime) as varchar) BETWEEN concat(FORMAT_DATETIME(DATE_ADD(day,-1,CURRENT_TIMESTAMP),yyyy-MM-dd), ,09:00:00) and 
concat(FORMAT_DATETIME(DATE_ADD(day,-1,CURRENT_TIMESTAMP),yyyy-MM-dd), ,12:00:00)

presto 查询每天固定时间段

标签:har   查询   ted   res   for   select   class   cas   and   

原文地址:https://www.cnblogs.com/dataxiong/p/12186947.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!