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-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 server to serve as

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

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: select count(*) from table where

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 somefield from LIMIT 100 and check the number of rows actually returned. I don't know which

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 to

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;

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: Microsoft Outlook Express 6.00.2600. - Original Message - From

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: SELECT

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 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 returned by the

RE: How to Count(*) with LIMIT

2002-05-02 Thread domi
] 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/2002, you wrote: I have a Where clause like: select count(*) from table where LIMIT 100

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 originally

RE: How to Count(*) with LIMIT

2002-05-02 Thread mos
loop through the recordset. (if it was that You ment with delay...) Yup Mike 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/2002, you wrote: I have a Where clause