Assistance with MySQL statement
Your basic query is correct, and I don't really see how you could make it simpler, given the definition of what you want to count.

You can simplify it slightly. You don't need the first DISTINCT; and you actually don't need a main FROM:

SELECT
   (SELECT COUNT(DISTINCT rule_id) 
      FROM ruleresult 
     WHERE code = '1.2' AND result = 'V') as v_count,
   (SELECT COUNT(DISTINCT rule_id) 
      FROM ruleresult 
     WHERE code = '1.2' 
        AND result = 'W' 
        AND rule_id NOT IN 
        (SELECT rule_id 
           FROM ruleresult 
          WHERE code = '1.2' 
            AND result IN ('V'))) as w_count,
    (SELECT COUNT(DISTINCT rule_id) 
       FROM ruleresult 
      WHERE code = '1.2' 
         AND result = 'P' 
         AND rule_id NOT IN 
         (SELECT rule_id 
            FROM ruleresult 
           WHERE code = '1.2' AND result IN ('V', 'W'))) as p_count ;


| v_count | w_count | p_count |
|---------|---------|---------|
|       1 |       1 |       0 |


Check it at SQLFiddle.



You can also have a different approach:


You first PIVOT your rules
You then decide, for every rule, whether the result that counts is V, W or P
You sum how many of them you have.


All together, this would be:

SELECT
    sum(is_v) AS v_count,
    sum(is_w) AS w_count,
    sum(is_p) AS p_count
FROM
(
    -- Computing whether we should consider V, W or P
    SELECT
        rule_id,
        case when count_v0 &gt; 0 then 1 else 0 end as is_v,
        case when count_w0 &gt; 0 and count_v0 = 0 then 1 else 0 end as is_w,
        case when count_p0 &gt; 0 and count_w0 = 0 and count_v0 = 0 then 1 else 0 end as is_p
    FROM
    (
        -- Pivoting V, W, P
        SELECT
            rule_id, 
            count(case when result='V' then 1 end) AS count_v0,    
            count(case when result='W' then 1 end) AS count_w0,
            count(case when result='P' then 1 end) AS count_p0
        FROM
            ruleresult
        WHERE
            code = '1.2'
        GROUP BY
            rule_id 
    ) AS s0 
) AS s1;


You can check this second option at RexTester. This second approach is (most probably) more efficient if your table is big, because it will only scan it once...