Dale,

Forgot to mention that the DBMS is MySQL 3.23 (it is not our db, its a
client db) and they won't update it because they have some old software.  So
no nested queries.

Thanks.


DNewfield wrote:
> 
> Daniel.Rodriguez wrote:
>> I have a Class called Categoria (Category) that has a List of categories
>> (sub-categories).  
>> 
>> I'm trying to build a HQL query that can gives me all the Categories that
>> are not a subcategory of another category.  
>> 
>> In SQL is dead simple :
>> 
>> SELECT cat.id 
>> FROM Categoria cat
>> LEFT OUTER JOIN subCategoria sc  
>> ON cat.id != sc.padre_id
> 
> select cat
> from Categoria cat, Categoria parent
> where parent.id = :theParentId
>        and cat not in elements(parent.subCategoria);
> 
> -Dale
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/SQL-v.s.-HQL-%28plz-help%29-tf4002808s2369.html#a11369348
Sent from the AppFuse - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to