How to sort by count

Hello!
I have a file with 4 columns. I am trying to have it sort first with respect to the first column, and then with respect to the number of counts (in descending count) in the second column within the same first column identity.

For example:

Input:
1 2 A 1
1 6 B 2
2 5 G 7
1 6 D 4
1 6 F 6
1 0 E 5
2 4 H 8
2 5 I 9
1 2 C 3

The output is to look like:
1 6 B 2
1 6 D 4
1 6 F 6
1 2 A 1
1 2 C 3
1 0 E 5
2 5 G 7
2 5 I 9
2 4 H 8

As you can see:
-Within the first column identity=1, there are 3 counts of '6', 2 counts of '2' and 1 count of '0' in the second column.
-Within the first column identity=2, there are 2 counts of '5' and 1 count of '4' in the second column.
They are both sorted with respect to descending count in the second column, not in arithmetic order.

I have been doing this in excel and it became quite time consuming for me since the number of files to process has started to increase.

Thanks for your help in advance!

Please do not double post. Closed
see http://www.unix.com/unix-dummies-questions-answers/133991-sort-respect-count.html\#post302411469