Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Sql queary.............

Author  Topic 

myharshdesigner
Starting Member

5 Posts

Posted - 2007-09-17 : 04:04:59
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

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2007-09-17 : 04:18:43
1 You should do this in Reports
2 Read about ROLLUP operator in sql server help file

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

myharshdesigner
Starting Member

5 Posts

Posted - 2007-09-17 : 04:20:18
what is Reports And What is Rollup and how to use it can you give me some example ? pl



quote:
Originally posted by madhivanan

1 You should do this in Reports
2 Read about ROLLUP operator in sql server help file

Madhivanan

Failing to plan is Planning to fail

Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2007-09-17 : 04:21:26
<<
i also wan to display all the rows which is presented in the database.
>>

Where do you want to display data?

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

myharshdesigner
Starting Member

5 Posts

Posted - 2007-09-17 : 04:25:34
in a table on the same page.........


quote:
Originally posted by madhivanan

<<
i also wan to display all the rows which is presented in the database.
>>

Where do you want to display data?

Madhivanan

Failing to plan is Planning to fail

Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2007-09-17 : 04:28:59
<<
in a table on the same page.........
>>

What do you mean by page?
Query Analyser, Reporting tool's page, webpage, etc???


Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

myharshdesigner
Starting Member

5 Posts

Posted - 2007-09-17 : 04:33:12
oo sorry

i will test in the Query Analyser if it will work fine then i will use it on Web page..

So tel me only for Query Analyser.

Thanks.




quote:
Originally posted by madhivanan

<<
in a table on the same page.........
>>

What do you mean by page?
Query Analyser, Reporting tool's page, webpage, etc???


Madhivanan

Failing to plan is Planning to fail

Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2007-09-17 : 04:36:56
Note that you can generate group total in a webpage when you loop thru all the records there
(You need to reset the total whenever group changes). Try it over there. There is no need to generate this in a query and then send data to a webpage


Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

myharshdesigner
Starting Member

5 Posts

Posted - 2007-09-17 : 04:39:22
i think this will be done automatically by sql queary then we just only have to display the result in a web page.

there is something like group by or some group..??????



quote:
Originally posted by madhivanan

Note that you can generate group total in a webpage when you loop thru all the records there
(You need to reset the total whenever group changes). Try it over there. There is no need to generate this in a query and then send data to a webpage


Madhivanan

Failing to plan is Planning to fail

Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-09-17 : 04:59:34
Post sample and accurate sample data together with your expected result of the magic query.



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2007-09-17 : 05:00:34
<<i
think this will be done automatically by sql queary then we just only have to display the result in a web page.
>>

Well. You should know how to generate groupwise total at webpage
If you want to generate this in query analyser, as I told you, read about ROLLUP operator in sql server help file. If you dont have help file, do google search for the same



Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

jezemine
Master Smack Fu Yak Hacker

2886 Posts

Posted - 2007-09-17 : 09:44:49
queary = query + weary?


elsasoft.org
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2007-09-17 : 10:16:54
quote:
Originally posted by jezemine

queary = query + weary?


elsasoft.org


Yes it is

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -