'Is there a way to count the number of values in column?

I am a newbie studying MSSQL and Database. I am trying to write a SQL query to count values in the column. Following table is original one.

name value
----------
  A    1
  A    1
  A    2
  B    1
  B    2

I want to get a table like this.

name  one  two
--------------
  A    2    1
  B    1    1

A has two 1 and one 2 and B has one 1 and 2. It seems I can accomplish it using COUNT built-in function. I tried but failed. Is there any idea to do it?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source