lundi 2 mars 2015

DB2 - Sql to get only the multiple records starting from 1 in row number function


Please help me in writing a sql script to get only the multiple records in row number function inclusive of rownumber 1 record.


Example:



***Column 1 Column2 Row_number***

Apple orange 1

Apple Grapes 2

Apple Banana 3

Orange Strawberry 1


Need to get all the rows of apple starting from 1


I have tried below condition which is not working correctly.



WHERE Rnk >= 1
AND Rnk < ( 1 + 50 )




Aucun commentaire:

Enregistrer un commentaire