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
 SQL Server Development (2000)
 Problem in Group by Clause

Author  Topic 

jyothi_jayanth
Starting Member

7 Posts

Posted - 2001-12-13 : 01:21:27
Hi
I am facing some problem in grouping the records..
Here my reslut like this
101 name1 1000
101 name2 2000
For exmple the about records are the result of

select field1,field2,sum(field3) from table group by field1,field2

But i reuires the query result sholud be as below
101 name1 3000
Can anybody give me Sql-statement for this

thanks a lot in advance
jayanth

Jayanthu Babu gadde

Nazim
A custom title

1408 Posts

Posted - 2001-12-13 : 01:36:48
On what condition are u taking name1 and omitting name2 .

this shoud do ur job

select field1,min(field2),sum(field3) from table
group by field1



-------------------------
"Success is when Preparedness meets Opportunity"
Go to Top of Page
   

- Advertisement -