Results 1 to 12 of 12
Thread: Count on 2 columns
Dec 16, 2012, 12:54 #1
- Join Date
- Jul 2011
- 0 Post(s)
- 0 Thread(s)
Count on 2 columns
If I use count on one column as: SELECT master_project, count(master_project ) AS mycounter FROM property GROUP BY master_project
I am getting distinct rows with their counters. I want to use same for 2 columns by one query.
When I try to apply count on 2 columns as
SELECT master_project, count(master_project ) AS mycounter, project, count(project ) AS myprojectcounter
FROM property GROUP BY master_project, project
In this case I don't get my expected results where as I want to see both columns having distinct records with counters regardless of each other.