SUMIF Query Returning One Line
<p>I have a database like facebook. A query asks me to count how many Male friends, Female friends and Null friends (no sex specificated).</p>

<p>I have this query so far, but it only returns 1 row, not all the users.</p>

<pre><code>create or replace view friends as

select  fs.user_id,
        fs.user_id_friend,
        sum(if(fs.sex = 'M', 1, 0)) as Male_Friends,
        sum(if(fs.sex = 'F', 1, 0)) as Female_Friends,
        sum(if(fs.sex = ' ', 1, 0)) as Friends_Undefined_Sex
from friends_sex fs;
</code></pre>

<p>This prints me only one row ans I need it to print all the users, can anyone please help me out? </p>

<p>If you need more info about the tables or views ask for it, I'm quite new to this forum so excuse me for any mistakes.</p>