2016-09-18 71 views
0
create table db_db.result_av1 as 
(select distinct user_name 
from   movies.user_activity a 
left outer join (select activity_count as result 
        from movies.user_activity 
        where user_activity like "%gz%") 
) d 
(on a.user_name=d.user_name) 
where a.date between '2015-05-10' and '2015-08-04' 
and substr(user_name,1,24) is Not null 
limit 5; 

得到錯誤使用左外獲取語法錯誤在蜂巢查詢創建表連接

錯誤在編譯時聲明:失敗:
ParseException的第9行:0缺少在EOF「(」近「 。d」

回答

0

你的括號不放在右試試這個:

create table db_db.result_av1 as 
select distinct user_name 
from   movies.user_activity a 
left outer join (select activity_count as result 
        from movies.user_activity 
        where user_activity like "%gz%") d 
       on a.user_name=d.user_name 
where a.date between '2015-05-10' and '2015-08-04' 
and substr(user_name,1,24) is Not null 
limit 5; 
+0

仍然給出錯誤「編譯語句時出錯:失敗:parseexception行2:0無法識別輸入附近'(''select''distinct'in select clause」 – BangingHeadAgainstWall

+0

您嘗試刪除違規括號(第一次打開和最後一次關閉)? – trincot