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)
 USING MIN(column) as a where condition

Author  Topic 

slafta
Starting Member

1 Post

Posted - 2006-02-06 : 00:30:00
subject: USING MIN(column) as a where condition
select MIN(dtl_seq) from table


here is the scenario:
table name : table

looks like this:
__________________________
trans_seq dtl_seq
316372 3
316372 6
316372 7
__________________________

now i as trying to return anything above the min of column dtl_seq
so run query to find min is this:

select MIN(dtl_seq) from table

how would you you run a select to return where dtl_seq > min(dtl_seq)

any help appreciated..

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2006-02-06 : 00:31:53
[code]select *
from table
where dtl_seq > (select min(dtl_seq) from table)[/code]

----------------------------------
'KH'


Go to Top of Page
   

- Advertisement -