I need help from you, this is my sql query:
select count(SID)
from Test
where Date = '2012-12-10'
group by SID
this is my result:
|2|
|3|
|4|
|3|
and now I have to count the results from first query!
Expected result: 4
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.
You can wrap your query in another
SELECT:See SQL Fiddle with Demo
In order for it to work, the
count(SID)need a column alias and you have to provide an alias to the subquery itself.