Query Help

  • I have a table(More than 35000 records) having two columns 'Dates' and 'Price', i need to get the maximum price from the top 100 records order by dates desc. I wrote the query below

    Select top 100 max(price) from tab1

    but it is giving the maximum price out of the entire records, any suggestion ?

  • select max(price)

    from (

    select top 100 price

    from tab1

    order by dates desc) a

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

You must be logged in to reply to this topic. Login to reply