sql server - Sql query to select 3rd element from data? -
this question has answer here:
- how select nth row in sql database table? 27 answers
i have written sql query
select * products products.category=="fruits";
the returned answer is
1-banana 2-mango 3-apple 4-oranges 5-grapes
now want select fruit @ index 3rd apple using sql indexes problem arises every how should select element @ 3rd place using index in sql query?
sql server 2012 supports offset
, fetch
, query should this:
select * products products.category ='fruits' order products.category -- or whatever column need sort on offset 3 rows fetch next 1 row only;
Comments
Post a Comment