I want to know how to query a table with both distinct and count feature.
For example:
SELECT ID, Email, ProductName, ProductModel
FROM Products
What can I do to pull data with Distinct feature on ID and per ID, Count of Email?
From something like:
ID email ProductName
0 a [email protected] apple
1 b [email protected] orange
2 a [email protected] apple
3 b [email protected] orange
4 c [email protected] grapefruit
5 a [email protected] apple
6 b [email protected] orange
7 c [email protected] grapefruit
8 a [email protected] apple
9 a [email protected] apple
10 a [email protected] apple
To something like:
ID Count ProductName
0 a 6 apple
1 b 3 orange
2 c 2 grapefruit
Any help would be appreciated.