Hi Sebastian,

Thank you for your answer.

I tried your way, but still, I get a column with two values:

|---------------------
|COUNT(comment_agent)|
|--------------------|
|                   1|
----------------------
|                  47|
----------------------

What I need is just the 47.

Any ideas ?

Warm Regards,
Mário Gamito


Sebastian Mendel wrote:
Mário Gamito schrieb:
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.

just include only the things you want in the SELECT

also it seems you require only comment_agent LIKE '%Linux%' and NOT OR comment_approved=0 if you only need the '47'

SELECT COUNT(comment_agent)
from wp_comments
WHERE comment_agent LIKE '%Linux%'
GROUP by comment_approved



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

Reply via email to