Viewing 2 posts - 1 through 2 (of 2 total)
declare @n int,
@s-2 varchar(1000)
set @n=10
set @s-2 ='select min(your_field) from your_table where your_field in
(select top ' + convert(varchar(10,@n) + ' your_field from your_table order by...
November 21, 2003 at 10:30 am
#483165
An other solution is:
declare @n int
select min(your_field) from your_table where your_field in
(select top @n your_field from your_table order by your_field desc)
For me is more elegant.
Adrian
November 21, 2003 at 5:34 am
#483047