-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
Author Message
 Post subject: Is the following SQL possible in HQL?
PostPosted: Thu Nov 17, 2005 5:39 pm 
Beginner
Beginner

Joined: Thu Oct 20, 2005 12:34 am
Posts: 28
SELECT TL.subDocIndexId, T1.data AS modelic, T11.data AS sdc, T2.data AS chapnum, T3.data AS section, T4.data AS subsect, T5.data AS subject, T6.data AS discode, Tx7.data AS discodev, T8.data AS incode, T9.data AS incodev, T10.data AS itemloc FROM TagList TL, TagList TL2, Text T1, Text T2, Text T3, Text T4, Text T5, Text T6, Text Tx7, Text T8, Text T9, Text T10 , Text T11 WHERE TL.tagListId = T1.tagListId AND TL.tagDefTypId = (SELECT TDT.tagDefTypId FROM TagDefTyp TDT WHERE TDT.name LIKE 'modelic') AND T1.data LIKE 'F404GE' AND TL2.tagListId = (TL.tagListId - 5) AND TL2.tagDefTypId = (SELECT TDT.tagDefTypId FROM TagDefTyp TDT WHERE TDT.name LIKE 'dmodule') AND T11.textId = (T1.textId + 1) AND T11.data LIKE 'A' AND T2.textId = (T1.textId + 2) AND T2.data LIKE '72' AND T3.textId = (T1.textId + 3) AND T3.data LIKE '5' AND T4.textId = (T1.textId + 4) AND T4.data LIKE '0' AND T5.textId = (T1.textId + 5) AND T5.data LIKE '0001' AND T6.textId = (T1.textId + 6) AND T6.data LIKE '00' AND Tx7.textId = (T1.textId + 7) AND Tx7.data LIKE 'A' AND T8.textId = (T1.textId + 8) AND T8.data LIKE '005' AND T9.textId = (T1.textId + 9) AND T9.data LIKE 'A' AND T10.textId = (T1.textId + 10) AND T10.data LIKE 'Z' ORDER BY TL.subDocIndexId;


I was just curious... Anyone care to comment?

Thanks!


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 17, 2005 5:48 pm 
Expert
Expert

Joined: Sat Jun 12, 2004 4:49 pm
Posts: 915
i don't see any special (hql support subquery if database do it) and it is simple query

i think, yes


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 17, 2005 5:56 pm 
Beginner
Beginner

Joined: Thu Oct 20, 2005 12:34 am
Posts: 28
Ok, the biggest thing I was worried about was the Text table being aliased multiple times.

Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 17, 2005 6:14 pm 
Expert
Expert

Joined: Sat Jun 12, 2004 4:49 pm
Posts: 915
it isn't problem


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.