Forum Replies Created

Viewing 2 posts - 1 through 2 (of 2 total)

  • RE: Find Min/Max Values in a Set

    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...

  • RE: Find Min/Max Values in a Set

    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

Viewing 2 posts - 1 through 2 (of 2 total)