I want to write one mysql query to fetch all my table data and with total records count.
For eg. this is my table
ID Name typeId
1 test1 1
2 test2 1
3 test3 2
If I am going to fetch data with type id 1 I need a result like this
Name count
test1 2
test2 2
How can I write sql for this kind of a result. I dont want subquery. I want to fetch data with out subquery Please help me.
Thanks