Reply to Re: SELECT COUNT(*) problem

Your name:

Reply:


Posted by King Louie on 08/04/05 16:48

It's hard to see why you would want a query like that.
It will allways return 20 (if the number of records with testfeild='0'
>= 20)
So I guess you want to check if there are more than 20 rows that
fullfill the where clause.

Try this:

SELECT COUNT(*) FROM
( SELECT * FROM 'testtable' WHERE testfeild = '0' LIMIT TO 20 ROWS)
AS x ;

Regards
Lars


On Wed, 13 Jul 2005 18:43:35 +0200, "JB" <nospam@nospam.dk> wrote:

>Hi
>Can somebody help me to get this to work.
>I want to count the only first 20 rows in my database width the contents
>'0' in the testfield
>
>I'v tried this, but it does not work.
>SELECT COUNT(*) FROM `testtable` WHERE testfeild ='0' limit 20
>
>Can somebody tell me what i'm doing wrong ?
>
>Regards
>Jorgen
>

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация