How to count this table Hi, how to count value in table like this?

This just example:

SELECT COUNT(name1) AS newResult1 FROM table


As this code just count column name1 and it will give result of 3.

What I want to do is count value in name1, name2, name3 and it give result based on value yes or no. Thanks.
I guess this is what you are looking for

 CREATE TABLE  newResult1 
    ( name1 CHAR(3),
      name2 CHAR(3),
      name3 CHAR(3)
     )


    INSERT newResult1 (name1,name2,name3)
    SELECT 'yes','no','yes'

    INSERT newResult1 (name1,name2,name3)
    SELECT 'yes','yes','yes'

    INSERT newResult1 (name1,name2,name3)
    SELECT 'no','no','yes'

    INSERT newResult1 (name1,name2,name3)
    SELECT 'no','no','no'



Declare @countofTableRows INT ;

select @countofTableRows= Count(1) from newResult1;

select [name1yes], @countofTableRows - [name1yes]  [name1No]
       ,[name2yes], @countofTableRows -[name2yes]  [name1No]
       ,[name3yes], @countofTableRows - [name3yes] [name1No]
from
(
select sum(case name1 when 'yes' then 1 else 0 end ) [name1yes]
,sum(case name2 when 'yes' then 1 else 0 end ) [name2yes]
,sum(case name3 when 'yes' then 1 else 0 end ) [name3yes]
from newResult1
)Resetset;