You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by "Manukyan, Sergey" <SM...@lear.com> on 2005/09/26 22:30:12 UTC

subQueries in SELECT

Folks,

Can I represent in OJB this SQL statement:

SELECT C.cust_id, (SELECT count(*) FROM purchases P WHERE P.cust_id =
C.cust_id)
FROM customer C

?

It looks like this kind of SQL is much faster then when using SELECTS
with GROUP BY and I would like to express it in OJB but didn't find how
in documentation,

Thank you,

Sergey


**********************
** LEGAL DISCLAIMER **
**********************

This E-mail message and any attachments may contain
legally privileged, confidential or proprietary
information. If you are not the intended recipient(s),
or the employee or agent responsible for delivery of
this message to the intended recipient(s), you are
hereby notified that any dissemination, distribution
or copying of this E-mail message is strictly
prohibited. If you have received this message in
error, please immediately notify the sender and
delete this E-mail message from your computer.

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org


Re: subQueries in SELECT

Posted by Jakob Braeuchi <jb...@gmx.ch>.
hi sergey,

please have a look at the subquery-testcases in 
org.apache.ojb.broker.QueryTest.

jakob

Manukyan, Sergey schrieb:
> Folks,
> 
> Can I represent in OJB this SQL statement:
> 
> SELECT C.cust_id, (SELECT count(*) FROM purchases P WHERE P.cust_id =
> C.cust_id)
> 
> FROM customer C
> 
> ?
> 
> It looks like this kind of SQL is much faster then when using SELECTS
> with GROUP BY and I would like to express it in OJB but didn't find how
> in documentation,
> 
> Thank you,
> 
> Sergey
> 
> 
> **********************
> ** LEGAL DISCLAIMER **
> **********************
> 
> This E-mail message and any attachments may contain
> 
> legally privileged, confidential or proprietary
> 
> information. If you are not the intended recipient(s),
> or the employee or agent responsible for delivery of
> 
> this message to the intended recipient(s), you are
> 
> hereby notified that any dissemination, distribution
> 
> or copying of this E-mail message is strictly
> 
> prohibited. If you have received this message in
> 
> error, please immediately notify the sender and
> 
> delete this E-mail message from your computer.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org