If running two queries is not out of the question for some principal
reasons, I'd suggest the following:
Run a query with LIMIT 1, 1. That query will return results ONLY if
there are two or more rows that match.
Then run your second query both inside the
and inside
.
I would suggest using
On Wednesday, August 28, 2002, at 06:06 , Tuomo Lesonen wrote:
> 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... :(
The count(*) syntax works in MyS
On Wed, 28 Aug 2002, Christian Haul wrote:
> On 28.Aug.2002 -- 01:29 PM, Tuomo Lesonen wrote:
> > Time to take out some heavier arms. Since I only need to
> > get "id" and "name"
> > from my table, I'm placing these pairs in a hashtable inside
> > . Then I have a nice hashtable, which I iterate
On 28.Aug.2002 -- 01:29 PM, Tuomo Lesonen wrote:
> Time to take out some heavier arms. Since I only need to
> get "id" and "name"
> from my table, I'm placing these pairs in a hashtable inside
> . Then I have a nice hashtable, which I iterate through
> later on. hashtables "size()" method gives th
nting 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 P
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
>
>
>
Time to take out some heavier arms. Since I only need to
get "id" and "name"
from my table, I'm placing these pairs in a hashtable inside
. Then I have a nice hashtable, which I iterate through
later on. hashtables "size()" method gives the rowCount.
BUT: How to implement "Enumeration" interface
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 do
> >
> > I'm not 100% sure but this highly probable to work
>
> Yes, if it is an option to run the query twice this should
On 28.Aug.2002 -- 10:54 AM, Leszek Gawron wrote:
> try to do select count(*) as row_count from table;
>
> and then in do
>
> 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 th
> > ...
> >
> > int rowCount = 0;
> > ...
> >
> > ...
> >
> > ...
> >
> > rowCount++;
try to do select count(*) as row_count from table;
and then in do
I'm not 100%
On 28.Aug.2002 -- 10:48 AM, Tuomo Lesonen wrote:
>
>
> On Wed, 28 Aug 2002, Christian Haul wrote:
>
> > On 28.Aug.2002 -- 10:07 AM, Tuomo Lesonen wrote:
> > > Hi,
> > >
> > > How can I count the rows in my resultset? I'm using esql, but
> > > doesn't seem to be implemented yet. SQL COUNT(*) do
On Wed, 28 Aug 2002, Christian Haul wrote:
> On 28.Aug.2002 -- 10:07 AM, Tuomo Lesonen wrote:
> > Hi,
> >
> > How can I count the rows in my resultset? I'm using esql, but
> > doesn't seem to be implemented yet. SQL COUNT(*) doesn't
> > work in this case either. Can I do this with XSP?
>
> Yes
On 28.Aug.2002 -- 10:07 AM, Tuomo Lesonen wrote:
> Hi,
>
> How can I count the rows in my resultset? I'm using esql, but
> doesn't seem to be implemented yet. SQL COUNT(*) doesn't
> work in this case either. Can I do this with XSP?
Yes, have a new var declared before the execute-query and ++ it
13 matches
Mail list logo