-->
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.  [ 1 post ] 
Author Message
 Post subject: SQL-query: return-scalar containing joined table?
PostPosted: Fri Feb 25, 2011 10:22 am 
Newbie

Joined: Mon Oct 19, 2009 4:56 am
Posts: 2
Hi guys,

I'm using a named SQL query to make some calculations on some data. My function uses return-scalar tags to return some integers. I was wondering if it's possible to join another table in my query, and returning that result as well?

My function looks a bit like this:

Code:
<sql-query name="do_something">
    <return-scalar column="id" type="int" />
    <return-scalar column="my-joined-table?" type="..." />
    <![CDATA[
        SELECT tn.id AS id,
        FROM TestTable1 tn
        LEFT JOIN TestTable2 tn2
          ON (tn.test_id=tn2.id)
        ...
        ...
      ]]>
</sql-query>


Thanks in advance!


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

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.