```
PK     Date      ID
=== =========== ===    
1   07/04/2017   22
2   07/05/2017   22  
3   07/07/2017   03    
4   07/08/2017   04     
5   07/09/2017   22    
6   07/09/2017   22    
7   07/10/2017   05
8   07/11/2017   03    
9   07/11/2017   03    
10  07/11/2017   03

```

I want to count the number of ID occurred in a given week/month, something like this.

```
ID  Count
22    3   --> count as 1 only in the same date occurred twice one 07/09/2017
03    2   --> same as above, increment only one regardless how many times it occurred in a same date
04    1
05    1

```

I'm trying to implement this in a perl file, to output/print it in a csv file, I have no idea on what query will I execute.