Damn, should proof-read... Should have been SELECT COUNT(id) FROM names WHERE id=1;
... of course... > -----Oorspronkelijk bericht----- > Van: Koen Pellegrims [mailto:[EMAIL PROTECTED]] > Verzonden: woensdag 28 augustus 2002 12:35 > Aan: [EMAIL PROTECTED] > Onderwerp: RE: Counting rows in a resultset > > > Try SELECT(id) FROM names WHERE id = 1; > > K. > > > -----Oorspronkelijk bericht----- > > Van: Tuomo Lesonen [mailto:[EMAIL PROTECTED]] > > Verzonden: woensdag 28 augustus 2002 12:07 > > Aan: [EMAIL PROTECTED]; [EMAIL PROTECTED] > > Onderwerp: Re: Counting rows in a resultset > > > > > > > > > > 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 > > > [EMAIL PROTECTED] > > > 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: <[EMAIL PROTECTED]> > > > For additional commands, e-mail: <[EMAIL PROTECTED]> > > > > > > > > > --------------------------------------------------------------------- > > 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: <[EMAIL PROTECTED]> > > For additional commands, e-mail: <[EMAIL PROTECTED]> > > > > > > > --------------------------------------------------------------------- > 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: <[EMAIL PROTECTED]> > For additional commands, e-mail: <[EMAIL PROTECTED]> > > --------------------------------------------------------------------- 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: <[EMAIL PROTECTED]> For additional commands, e-mail: <[EMAIL PROTECTED]>