I think this change will get you what you want:
SELECT comment_approved, COUNT(comment_agent)
from wp_comments
WHERE comment_agent LIKE '%Linux%' AND comment_approved=0
GROUP by comment_approved
andy
Mário Gamito wrote:
> Hi,
>
> I'm trying to get a single number out of a SELECT statement:
>
> SELECT comment_approved, COUNT(comment_agent) from wp_comments WHERE
> comment_agent LIKE '%Linux%' OR comment_approved=0 GROUP by
> comment_approved
>
> But instead i get two rows:
>
> |------------------------------------------
> |comment_approved | COUNT (comment_agent) |
> |------------------------------------------
> |0 | 1 |
> |------------------------------------------
> |1 | 47 |
> |-----------------------------------------|
>
> I've Google about it but found no answer (my bad, probably).
>
> What I want is to have just 47 as a result of the SELECT.
>
> Any help would be appreciated.
>
> Warm regards,
> Mário Gamito
>
--
Andy Wallace - CISData - IDX Slave
AIM: acmwallace awallace@stripped