Q:

select/sum of a column with different conditions in 1 query

$pos = select * from score_history where content_id = 6 && val = 1 
$neg = select * from score_history where content_id = 6 && val = -1  

i want to get the pos and neg scores in one query 
but i dont want to use join 
so perhaps some sort of IF/case statement ? 
i've this but  as you can guess it fails
SELECT  count(*) as total , 
CASE 
    WHEN `val` =  1  THEN count(*) as `pos` 
    WHEN `val` = -1  THEN count(*) as `neg` 
END
FROM    score_history WHERE `content_id` = '46083' ";

is there any way to do this without using join or sub query ? 

A:

You can make use of the flexibility of MySQL to handle booleans and integers:
SELECT  count(*) total, sum(val = 1) pos, sum(val = -1) neg
FROM    score_history 
WHERE   content_id = '46083';

Whenever the condition is true it is a 1.  Otherwise a 0.  No CASE needed nor GROUP BY.