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)
 aggregate function in where condition

Author  Topic 

manu
Starting Member

41 Posts

Posted - 2005-11-04 : 05:41:41
hi,

i have a problem.

suppose i have a database having 3 fields

ename evalue etext
manu 25 m
manu 24 n

i want to get min evalue record and compare it with some other field
my query should be like this

select etext from database where min (evalue)> 20

how we can use minimun value in where condition.

Munish Gupta







madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-11-04 : 05:56:48
You need to use Group by and Having

select etext from database group by etext having min (evalue)> 20

Otherwise post some sample data and the result you want


Madhivanan

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

manu
Starting Member

41 Posts

Posted - 2005-11-04 : 08:07:29
thanks sir,

it is ok now

Go to Top of Page
   

- Advertisement -