I have a table. My table includes a column. I want to get same value count then view.
My table like this
ID
---
2
2
3
4
2
I want to get result table like this:
ID | Count
---|---
2 | 3
3 | 1
4 | 1
Group By is what you're looking for.
Select Id, Count (*) CountOfRows
From MyTable
Group By Id
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With