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
>
Navigation:
[Reply to this message]
|