ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Fullam, Jonathan, ALABS" <jful...@att.com>
Subject RE: Select count(*) in a resultMap
Date Fri, 27 Jan 2006 20:12:46 GMT
You can use "value" as the alias if you want to map the count to an Integer or String resultClass.

select count(*) as value from SOME_TABLE

-----Original Message-----
From: Ted Schrader [mailto:tschrader@gmail.com]
Sent: Friday, January 27, 2006 3:10 PM
To: user-java@ibatis.apache.org
Subject: Re: Select count(*) in a resultMap


Hi Michael,

Try giving the resulting column an alias:

SELECT COUNT(*) AS MY_TOTAL FROM TABLE.

Then, use "MY_TOTAL" in your result map configuration.

Ted

On 27/01/06, Michael Laccetti <michael@s2g-limited.com> wrote:
>
>
>
> Is it possible to do a 'select count(*) from table' and then reference that
> value in a result map?  I've been searching around and trying to get it to
> work to no avail.
>
>
>
> Mike

Mime
View raw message