SQL Error [2788] [0A000]: [Vertica]VJDBC ERROR: operator <> is not supported
gg1234
Vertica Customer
I'm getting an error
"SQL Error [2788] [0A000]: [Vertica]VJDBC ERROR: Correlated subquery in expression with operator <> is not supported" When I try to execute this statement on Vertenter code hereica, but I can used this stetement on the SQL Server.
SELECT test.ID ,test.Nameenter code here
FROM test inner join test2 f on f.ID = test.ID
WHERE (test.Status IN ('PASS', 'COMPLETED'))
AND ( test.PLANID = 0 or test.ProjectID <> (select a.ProjectID from test a where test.PLANID = a.ID ))
Could anyone suggest me the correct statement?
Thank you
Tagged:
0
Answers
NOT IN
?https://www.vertica.com/docs/10.0.x/HTML/Content/Authoring/SQLReferenceManual/LanguageElements/Predicates/IN-predicate.htm
BTW, you're missing parenthesis.
Dear LenoyJ
I tried to use "NOT IN", but it return the same error about "NOT IN" is not supported.
Whoops, sorry. Should've paid attention to what your query was trying to do.
Correlated sub-queries (i.e queries that requires data from the outer query) are not supported with
NOT IN
.See: https://www.vertica.com/docs/10.0.x/HTML/Content/Authoring/AnalyzingData/Queries/Subqueries/SubqueryRestrictions.htm
Consider this example: