You can try sql like this:
|SELECT DT,SUB FROM ( SELECT DT,SUBSTRING(NAME,1,4) AS SUB FROM
TEST_KYLIN GROUP BY DT,NAME ) T WHERE T.SUB = 'xxxx' |||
?? 2015??11??13?? 16:53, ?????? ????:
I can not solve it in sub-query,because the substring function can't use in any
situation in where clause,so I had to add column in hive to avoid this problem,
such as add a column like substring(columnA exists in sourceTable,0,4) as new
column in hive table,and only in this way can I query this column without any
substring function.
Thanks for helping!
xingchen