hive的不等查询只能放在where条件中

/opt/hive-0.9.0/bin/hive -e "use ent;select distinct c.userid from (select a.userid ,a.stat_date from t_result_channel_login_user_detail a inner join (select fk_origin_user,datecol from t_user where datecol between '20150116' and '20150416') b on (a.userid = b.fk_origin_user ) where a.datecol between '2015-01-16' and '2015-04-16' and regexp_replace(a.stat_date,'-', '') > b.datecol order by a.userid) c ;" > 20150417_3_month_login_userid.csv

相关推荐