hello,
here the data i have in my table with this select query:
select name, date, count(*) from mytable
group by name, date
order by name
name date count(*)
------ --------- ----------
john 01/01 3
john 02/01 1
john 03/01 2
smith 12/01 4
smith 02/01 3
however, I WANT TO have the count as SUBTOTAL OR TOTAL of EACH NAME with the result will look like this:
name count(*)
------ ----------
john 6
smith 7
DO I NEED TO USE SOME KIND OF NESTED QUERY OR SUBQUERY? PLEASE HELP ME, THANK YOU SO MUCH.
here the data i have in my table with this select query:
select name, date, count(*) from mytable
group by name, date
order by name
name date count(*)
------ --------- ----------
john 01/01 3
john 02/01 1
john 03/01 2
smith 12/01 4
smith 02/01 3
however, I WANT TO have the count as SUBTOTAL OR TOTAL of EACH NAME with the result will look like this:
name count(*)
------ ----------
john 6
smith 7
DO I NEED TO USE SOME KIND OF NESTED QUERY OR SUBQUERY? PLEASE HELP ME, THANK YOU SO MUCH.