impala sql中的嵌套select语句

slsn1g29  于 2021-06-26  发布在  Impala
关注(0)|答案(1)|浏览(543)

我在impala中有以下sql查询

SELECT currentdate,close
FROM ( SELECT * FROM spyprice)
Where currentdate between '2015-01-16' and '2016-06-17';

它给了我一个错误:

Starting Impala Shell without Kerberos authentication

ERROR: AnalysisException: Syntax error in line 15:
  WHERE currentdate BETWEEN '2015-01-16' and '2016-06-17'
^
 Encountered: WHERE
  Expected: AS, DEFAULT, IDENTIFIER

 CAUSED BY: Exception: Syntax error

有人知道发生了什么吗?提前谢谢!

z9ju0rcb

z9ju0rcb1#

@james xiang查询语句的正确语法是:

SELECT a.currentdate, a.close FROM 
( 
SELECT * FROM spyprice
) a
Where a.currentdate between '2015-01-16' and '2016-06-17';

相关问题