none
Selecting percentage of table records in sql server

    Question

  • Hi,

     

    I am trying to make selection of top 30% and bottom 70% ordered results in a table.

     

    I am using :

    select top (30)percent from table 1
    
    select top 
    (70)percent from table 1 order by desc

     

    Problem is that if the record has same values for that ordered column then I might pick the same record twice.

     

    Any suggestions how to avoid this?
    Monday, August 26, 2013 8:31 PM

Answers