Here is a sample table that mimics my scenario:
COL_1 COL_2 COL_3 COL_4 LAST_COL A P X NY 10 A P X NY 11 A
If I am understanding correctly all you need is something like:
SELECT COL_1,COL_2,COL_3,COL_4, COUNT(*) AS TOTAL FROM table GROUP BY COL_1,COL_2,COL_3,COL_4