我从Redshfit收到以下查询的错误消息:
SELECT relation_447.col_alias_1,
relation_447.col_alias_2,
relation_447.col_alias_3,
relation_447.col_alias_4,
ROW_NUMBER() OVER (PARTITION BY relation_447.col_alias_3 ORDER BY relation_447.col_alias_4 ASC) AS col_rnk
FROM (SELECT NULL::VARCHAR(60) AS col_alias_1,
X.A AS col_alias_2,
X.A AS col_alias_3,
Y.B AS col_alias_4
FROM X
LEFT JOIN Y ON X.A = Y.C) relation_447
错误讯息:
Amazon(500310) Invalid operation: ORDER/GROUP BY expression not found in targetlist;
但是,如果我将NULL::VARCHAR(60)
短语替换为NULL::VARCHAR
,则查询工作正常。
同样,NULL::NUMERIC
的查询将失败。但如果我用NULL::BIGINT
替换该短语,它将再次起作用。
我想知道这是一个错误还是有任何解决方案?