Hello,

My example was too simple to explain my pb ... , but in fact here is
what I want to do :

My Object B contains a label and a validity date.
There may be a lots of B with the same label - but distinct validity
date -

My Object A has a Collection of B.

I need to know how many A have a reference on B having "XXXX" label -
whatever validity date is -

I'ld like to write this sql statement :

Select count(distinct a) from A a where a.collB.label="XXXX"

Sylvie.
___________________
CREDI RA
Sylvie Palluel

[EMAIL PROTECTED]
___________________



> -----Message d'origine-----
> De : Schlachter, Steffen (LDS) [mailto:[EMAIL PROTECTED] 
> Envoy� : mardi 8 juillet 2003 10:58
> � : [EMAIL PROTECTED]
> Objet : Re: [castor-dev] OQL - select count (distinct a) from 
> A a where ...
> 
> 
> Sylvie,
> 
> I believe that you don't need a distinct in your query anyway 
> as 'a' is already unique. Is that true perhaps?
> 
>    Steffen
> 
> 
>  
> 
> -----Ursprungliche Nachricht-----
> Von: PALLUEL Sylvie [mailto:[EMAIL PROTECTED]
> Gesendet: Dienstag, 8. Juli 2003 10:41
> An: [EMAIL PROTECTED]
> Betreff: [castor-dev] OQL - select count (distinct a) from A 
> a where ...
> 
> 
> Hello,
> 
> I'm trying to build an OQL query to do :
> 
> Select count(distinct a) from A a where a.lib="AZERTY";
> 
> The OQL syntax tells :
> aggregateExpression  count( (query | *) )
> 
> So I tried "select count(select distinct a from A a where
> a.lib="AZERTY") from A a" ... Doesn't seem to be good ...
> 
> Is there somewhere OQL query build examples ?
> 
> Sylvie. 
> ___________________
> CREDI RA
> Sylvie Palluel
>  
> [EMAIL PROTECTED]
> ___________________
> 
> 
> 
> 
> 
> **********************************************************************
> This email and any files transmitted with it are confidential 
> and intended solely for the use of the individual or entity 
> to whom they are addressed. If you have received this email 
> in error please notify the system manager.
> 
> This footnote also confirms that this email message has been 
> swept by MIMEsweeper for the presence of computer viruses.
> 
www.mimesweeper.com
**********************************************************************

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev




**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.

www.mimesweeper.com
**********************************************************************

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

Reply via email to