RE: How to Count(*) with LIMIT

2002-05-03 Thread mos
At 09:46 AM 5/3/2002, you wrote: > > Nope. :) > > The table could be in excess of 1 million rows. The > > user sees just the > > first 100 rows no matter what. If he wants to see a > > different group of > > records he can use the search fields at the top of > > the form. I want the web > > serve

RE: How to Count(*) with LIMIT

2002-05-03 Thread olinux
> Nope. :) > The table could be in excess of 1 million rows. The > user sees just the > first 100 rows no matter what. If he wants to see a > different group of > records he can use the search fields at the top of > the form. I want the web > server to serve as many pages/sec as possible and >

RE: How to Count(*) with LIMIT

2002-05-02 Thread mos
ry is > > executed. Right now it is done when the page first loads. But that >should > > be a trivial matter (I hope!). > >You can call mysql_num_rows() directly after query BEFORE you >loop through the recordset. (if it was that You ment with "delay"...) Yup Mike >---

Re: Re: How to Count(*) with LIMIT

2002-05-02 Thread Jeff Kilbride
> That would give the correct result, but it would still physically count all > the rows in the table which takes too long. This code will execute every > time a web page opens that has a grid. Some of the grid pages are quite > large, > 1 million rows. The person who designed the web page origina

RE: How to Count(*) with LIMIT

2002-05-02 Thread domi
"delay"...) --- =d0Mi= , DCS.net [EMAIL PROTECTED] Original Message - Date: 2-May-2002 17:22:44 +0200 From: mos <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Subject: RE: Re: How to Count(*) with LIMIT > At 03:48 AM 5/2/2

Re: Re: How to Count(*) with LIMIT

2002-05-02 Thread Ryan Fox
- Original Message - From: "mos" <[EMAIL PROTECTED]> > > > I have a Where clause like: > > > select count(*) from table where LIMIT 100 > > > Unfortunately the Count(*) ignores the LIMIT clause entirely. Why? >> > >If You want to know the number of rows in the recordset retu

RE: Re: How to Count(*) with LIMIT

2002-05-02 Thread Svensson, B.A.T. (HKG)
> I have a Where clause like: > select count(*) from table where LIMIT 100 > Unfortunately the Count(*) ignores the LIMIT clause entirely. Why? The answer is: Because the SQL query with COUNT(*) only returns one row... -

RE: Re: How to Count(*) with LIMIT

2002-05-02 Thread mos
At 03:48 AM 5/2/2002, you wrote: > > I have a Where clause like: > > select count(*) from table where LIMIT 100 > > > > Unfortunately the Count(*) ignores the LIMIT clause entirely. Why? > > > >Because the query returns only ONE row and LIMIT limits rows, not values. >See ex. below

Fwd: Re: How to Count(*) with LIMIT

2002-05-02 Thread mos
>X-Sieve: CMU Sieve 2.1 >X-Mail-from: [EMAIL PROTECTED] >From: "Ryan Fox" <[EMAIL PROTECTED]> >To: <[EMAIL PROTECTED]>, "mos" <[EMAIL PROTECTED]> >Subject: Re: How to Count(*) with LIMIT >Date: Thu, 2 May 2002 08:42:28 -0400 >X-Mailer:

Re: How to Count(*) with LIMIT

2002-05-02 Thread Ryan Fox
- Original Message - From: "mos" <[EMAIL PROTECTED]> > I have a Where clause like: > select count(*) from table where LIMIT 100 > > Unfortunately the Count(*) ignores the LIMIT clause entirely. Why? You could use least(). mysql> select least(count(*),30) from ct; +-

Re: Re: How to Count(*) with LIMIT

2002-05-02 Thread Egor Egorov
mos, Thursday, May 02, 2002, 8:11:33 AM, you wrote: m> I have a Where clause like: m> select count(*) from table where LIMIT 100 m> Unfortunately the Count(*) ignores the LIMIT clause entirely. Why? Because first of all SELECT is executed and then LIMIT is applied. m> It seems t

Re: How to Count(*) with LIMIT

2002-05-02 Thread Joseph Bueno
Hi, LIMIT is applied AFTER select is executed and limits then number of rows returned to the client. Since SELECT COUNT(*)... generates a single row, LIMIT is useless. You can do this : SELECT from LIMIT 100 and check the number of rows actually returned. I don't know which programming lan

Fw: How to Count(*) with LIMIT

2002-05-02 Thread George Pitcher
Sorry, taken out of context please ignore my first response. George - Original Message - From: "George Pitcher" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]>; "mos" <[EMAIL PROTECTED]> Sent: Thursday, May 02, 2002 9:46 AM Subject: Re: How to Cou

Re: How to Count(*) with LIMIT

2002-05-02 Thread George Pitcher
Can't you use the num_rows funtion to provide the count? George - Original Message - From: "mos" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, May 02, 2002 6:11 AM Subject: Re: How to Count(*) with LIMIT > I have a Where clause like: >

RE: Re: How to Count(*) with LIMIT

2002-05-02 Thread domi
> I have a Where clause like: > select count(*) from table where LIMIT 100 > > Unfortunately the Count(*) ignores the LIMIT clause entirely. Why? > Because the query returns only ONE row and LIMIT limits rows, not values. See ex. below: SELECT count(login) FROM accounts WHERE d