i want to use Group by
but i also wan to display all the rows which is presented in the database.
And at the end of a group i want to display Some of all The rows in a group.
like i have 10 rows in a database and there is a three group
in 1st group there is 5 rows.
in 2nd group there is 2 rows.
and
in 3rd group there is 3 rows.
so i just want to display the sum of all amount in a group.
so pl tell me what query i suppose to use for getting what i want .
waiting for some help
with example
thanks
Sql queary
Moderator: General Moderators
- CoderGoblin
- DevNet Resident
- Posts: 1425
- Joined: Tue Mar 16, 2004 10:03 am
- Location: Aachen, Germany
Do you mean something like...
(where mygroup is the column you are grouping on).
Code: Select all
SELECT mygroup,count(mygroup) FROM tablename GROUP BY mygroup;