cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tuomo Lesonen <tleso...@cc.hut.fi>
Subject Re: Counting rows in a resultset
Date Wed, 28 Aug 2002 10:06:46 GMT


On Wed, 28 Aug 2002, Christian Haul wrote:

> On 28.Aug.2002 -- 10:54 AM, Leszek Gawron wrote:
> > try to do select count(*) as row_count from table;
> >
> > and then in <esql:row-results> do <esql:get-long column="row_count"/>
> >
> > I'm not 100% sure but this highly probable to work
>
> Yes, if it is an option to run the query twice this should work. The
> "as row_count" is not necessary if you access the count(*) by column
> number i.e. <esql:get-long column="1"/>

I did try these both. But COUNT(*) is not working, because I have to
specify more columns in the query. My query is something like this: SELECT
id, name FROM names WHERE id = 1;

This doesn't work: SELECT COUNT(*), id, name FROM names WHERE id = 1;

I'm using MS SQL2000. The query above is probably not well formed SQL, or
SQL2000 doesn't know what to do with it... :(

-Tuomo


>
> 	Chris.
> --
> C h r i s t i a n       H a u l
> haul@informatik.tu-darmstadt.de
>     fingerprint: 99B0 1D9D 7919 644A 4837  7D73 FEF9 6856 335A 9E08
>
> ---------------------------------------------------------------------
> Please check that your question  has not already been answered in the
> FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>
>
> To unsubscribe, e-mail:     <cocoon-users-unsubscribe@xml.apache.org>
> For additional commands, e-mail:   <cocoon-users-help@xml.apache.org>
>


---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <cocoon-users-unsubscribe@xml.apache.org>
For additional commands, e-mail:   <cocoon-users-help@xml.apache.org>


Mime
View raw message