I am trying to inlude the total count as a column in the query:
SELECT un.user, un.role
FROM [Unique] un group by user, role;
In this query I have 2 columns but I want to add a third column as the total rows calculated in the above query.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This works under MS Access (and is very similar to what would work under Oracle and other databases):
Here is the actual Oracle syntax:
For the reference, here is the SQL Server specific solution, using CTE: