Error: Correlated subquery could not be flattened as a join

Moderator: NorbertKrupa

Post Reply
debfawn
Beginner
Beginner
Posts: 47
Joined: Tue Jan 29, 2013 2:30 pm

Error: Correlated subquery could not be flattened as a join

Post by debfawn » Fri Nov 22, 2013 3:24 pm

Hi guys,

The following query works in Oracle, but I get an error in Vertica:

Code: Select all

dbadmin=> SELECT sd1.id,
dbadmin->        sd1.effective_time,
dbadmin->        sd1.active,
dbadmin->        sd1.module_id,
dbadmin->        (SELECT sd2.term
dbadmin(>           FROM file_description sd2
dbadmin(>          WHERE sd1.concept_id = sd1.module_id) module_description
dbadmin->   FROM file_description sd1;
ERROR 2784:  Correlated subquery could not be flattened as a join
How do I work around this?

scutter
Master
Master
Posts: 302
Joined: Tue Aug 07, 2012 2:15 am

Re: Error: Correlated subquery could not be flattened as a j

Post by scutter » Fri Nov 22, 2013 3:43 pm

Is this a typo? The predicate in the subquery is referring to two columns from the same table and not referring to any columns from sd2:

WHERE sd1.concept_id = sd1.module_id
Sharon Cutter
Vertica Consultant, Zazz Technologies LLC

Post Reply

Return to “New to Vertica SQL”