sql - How to Retrieve even rows in a table -
table a
columna --------- b c : : z
here how select rows. i've written query
select * (select row_number()over(order no asc ) number number mod(number,2)=0)as
it isn't working.
try
select * ( select *, row_number() on (order columna) rnum tablea ) q mod(rnum, 2) = 0
output:
| no | rnum | |----|------| | b | 2 | | d | 4 | | f | 6 |
here sqlfiddle demo
Comments
Post a Comment