关于mapjoin的问题
Re关于mapjoin的问题
试了下,我重新写了
select A.artist_id,A.Ds,datediff(A.Ds,max(tianchi_songs.publish_time),'dd') as timediff
from (select artist_id,play,Ds
from predicttable2
where action_type=1)A join tianchi_songs
on A.artist_id=tianchi_songs.artist_id
where tianchi_songs.publish_time group by A.artist_id,A.Ds
但是还是报错
Semantic analysis exception - E
xpression not in GROUP BY key : line 2:0 'ds'
一个个试过去 好像是datediff这个函数的问题, 谁能给我指出这部分哪有问题吗?SQL中是能运行的
-------------------------
回 2楼junkang的帖子
经过尝试 datediff(to_date(A.Ds,'yyyymmdd'),to_date(max(tianchi_songs.publish_time),'yyyymmdd'),'dd')
需要手动转换数据类型
赞1
踩0