Q:

SQL Aggregating over groups within colum

I have inferred the following table
CustomerID | OrderType | Date
=============================
1          | A         | 1/1
1          | B         | 2/1
1          | A         | 3/1
2          | A         | 1/1
2          | A         | 4/1
.... 

from a table containing an additional ID-column, using grouping via CustomerID and OrderType. 
In obtaining this tabular it astounded me, that I also need to select the Date column.  Otherwise the each customerID-Ordertype pair only occurs once (e.g. without that column the 3rd line would be absent.) 
In a next step I would like to count the number of Ordertype per Customer.  
I am able to do this in R (this can be easily done using dplyr).  However, since the file is quite large (and memory is an issue in MS sql Management studio), I would prefer to obtain directly a table of the following form
Customer ID | Count(Type_A) | Count(Type_B)
===========================================
1           | 2             | 1
2           | 2             | 0 
....  

As I said, this is an easy task with R. Can this also be obtained with SQL? 
I believe an implementation might require some self joins but, so far, I was not able to solve this problem. 
Any hints? 

A:

That are multiple aways to achieve it. 
A simple example(you can use either count or sum this way):
select 
    CustomerID,
    COUNT(case when OrderType = 'A' then 1 end) [COUNT(Type_A)],
    COUNT(case when OrderType = 'B' then 1 end) [COUNT(Type_B)]
from myTable
group by
    CustomerID

