Karthik M. wrote:
> Hello All,
> If my ejbquery is
> Select Object(c) from Customer c, Address a ;
> Which of the following sql queries is correct?
> a) Select c.name from Customer c, Address a;
> b) Select c.name from Customer c, Address a where
> c.fk_addressID= a.addressID;
>
> In mastering EJB 2 (pg 573) , it is said that first one is
> correct.But I feel that second one is correct because duplicates are
> removed.
>
> Please help me.
If Customer has a cmr-field named address, you can avoid the 'duplicates'
(cartesian product) by writing EJB QL as:
select object(c) from Customer c, in(c.address) a
That query could then correspond to the SQL (b).
> TIA
> Karthik.
>
>
>
>
>
>
>
>--------------------------------------------------------------------------------------------------------------------
> 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
> originator of the message.
>
> Any views expressed in this message are those of the individual
> sender, except where the sender specifies and with authority,
> states them to be the views of Huawei Technologies India Pvt. Ltd.
--
_______________________________________________________________________________
Evan Ireland Sybase EAServer Engineering [EMAIL PROTECTED]
Wellington, New Zealand +64 4 934-5856
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".