Re: Newbie: A single number

2008-01-23 Thread Joerg Bruehe
Hi Mário, all ! Mário Gamito wrote (re-ordered): 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

Re: Newbie: A single number

2008-01-21 Thread Andy Wallace
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: SEL

Re: Newbie: A single number

2008-01-21 Thread Mário Gamito
Hi Michael, I've tried your tip, but I get the error: "#1054 - Unknown column 'ct_ct_comment_agent' in 'field list'" Any ideas ? Warm Regards, Mário Gamito Michael Cole wrote: You have two rows the zero which has a single row and the other row If the answer you are after is 48. select sum(

Re: Newbie: A single number

2008-01-21 Thread Mário Gamito
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. An

Re: Newbie: A single number

2008-01-21 Thread Michael Cole
You have two rows the zero which has a single row and the other row If the answer you are after is 48. select sum(ct_ct_comment_agent) from (SELECT comment_approved, COUNT(comment_agent) as ct_comment_agent from wp_comments WHERE comment_agent LIKE '%Linux%' OR comment_approved=0 GROUP by comme

Re: Newbie: A single number

2008-01-21 Thread Sebastian Mendel
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: |

Newbie: A single number

2008-01-21 Thread Mário Gamito
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_