Re: [SPAM] How to perform a subquery??

Shai Berger <shai-9mtU2oJkgntWk0Htik3J/[email protected]> Wed, 7 Oct 2015 01:52:31 +0300
Newsgroups gmane.comp.python.db.cx-oracle
Organization Platonix Joint Ventures
Message-ID <[email protected]>
Hi Eduardo,

On Tuesday 06 October 2015 23:25:48 Eduardo Nascimento wrote:
> 
> My question is how to do a subquery, every time is like a subquery displays
> an error:
> 

What makes you think the problem is with subqueries?

> DatabaseError: ORA-00936: missing expression
> 
> 
>  Attached the file that I am using sql and script in python.
> 
> 
> 
> Could help me with this issue?

Try executing the queries one-by-one. Your current code tries to execute a 
string with several queries in it as if it were one query (and if I understand 
correctly, the error is caused because Oracle sees, in the first query:

...
 group by mc.conn_source_1

-select ...

Oracle tries to parse that as an expression -- (mc.conn_source_1 - something) 
except that, instead of "something", it finds the reserved word "select" -- 
hence a missing expression.

HTH,
	Shai.

------------------------------------------------------------------------------