Let's say I have a table with the following value

```
1
1
1
2
2
2
3
3
3
1
1
1
2
2
2

```

I need to get an out put like this, which counts each occurances of a
particular value

```
 1  1
 1  2
 1  3
 2  1
 2  2
 2  3
 3  1
 3  2 
 3  3
 1  1
 1  2
 1  3
 2  1
 2  2
 2  3

```

NB: This is a sample table Actual table is a complex table with lots of rows and columns and query contains some more conditions