Header Ads

MS-SQL : ROW_NUMBER 순번으로 WHERE 찾기

SELECT ranks,field1,field2
  FROM(
       SELECT ROW_NUMBER() OVER (ORDER BY field1,field2 ASC) AS ranks
             ,field1
             ,field2
         FROM TABLE_NAME
      ) A
 WHERE ranks = 18
 ORDER BY field1,field2 ASC

No comments

Copyright 2016, minki. All rights reserved. Powered by Blogger.