Use COUNT():

SELECT COUNT( id ) FROM test WHERE LEFT( id, 5 ) = '12345' GROUP BY value;

Wes



On Tue, 21 Sep 2004 00:24:33 +0200, Alexander Newald
<[EMAIL PROTECTED]> wrote:
> Hello,
> 
> I like to get the number of lines returned by a select ... group by query:
> 
> Example:
> 
> SELECT id FROM test WHERE LEFT(id,5) = "12345" GROUP BY value;
> 
> Perhaps I will get
> 
> +-----------+
> | id        |
> +-----------+
> |         2 |
> |         1 |
> |         5 |
> +-----------+
> 3 rows in set (0.02 sec)
> 
> But I like to simply get 3
> 
> As I use mySQL 3.x and can't change it for now I'm not able to use
> "FOUND_ROWS()"
> 
> Thanks,
> 
> Alexander Newald
> 
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]
> 
>

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to