簡體   English   中英

Athena 查詢錯誤:外部輸入'select' expecting

[英]Athena query error : extraneous input 'select' expecting

運行查詢時出錯:

extraneous input 'select' expecting {'(', 'add', 'all', 'some', 'any', 'at', 'no', 'substring', 'position', 'tinyint', 'smallint', 'integer', 'date', 'time', 'timestamp', 'interval', 'year', 'month', 'day', 'hour', 'minute', 'second', 'zone', 'filter', 'over', 'partition', 'range', 'rows', 'preceding', 'following', 'current', 'row', 'schema', 'comment', 'view', 'replace', 'grant', 'revoke', 'privileges', 'public', 'option', 'explain', 'analyze', 'format', 'type', 'text', 'graphviz', 'logical', 'distributed', 'validate', 'show', 'tables', 'views', 'schemas', 'catalogs', 'columns', 'column', 'use', 'partitions', 'functions', 'to', 'system', 'bernoulli', 'poissonized', 'tablesample', 'unnest', 'array', 'map', 'set', 'reset', 'session', 'data', 'start', 'transaction', 'commit', 'rollback', 'work', 'isolation', 'level', 'serializable', 'repeatable', 'committed', 'uncommitted', 'read', 'write', 'only', 'call', 'input', 'output', 'cascade', 'restrict', 'including', 'excluding', 'properties', 'function', 'lambda_invoke', 'returns', 'sagemaker_invoke_endpoint', 'nfd', 'nfc', 'nfkd', 'nfkc', 'if', 'nullif', 'coalesce', identifier, digit_identifier, quoted_identifier, backquoted_identifier}

查詢是右連接表 ss 與 dd,如:

select * from 
(
select platform, id, nextMonth
FROM "logs"."user_records"   as ss
right join 
select id as idRight, platform, month
FROM "logs"."user_records"  as dd

on ss.platform = dd.platform and ss.userid = dd.useridRight and ss.nextMonth=dd.month   ) 

您可能需要在正確加入括號后將子查詢括起來。 未經測試,但我猜:

select * from 
(
select platform, id, nextMonth
FROM "logs"."user_records"   as ss
right join 
( select id as idRight, platform, month
FROM "logs"."user_records" )  as dd

on ss.platform = dd.platform and ss.userid = dd.useridRight and ss.nextMonth=dd.month   ) 

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM