sql >> Base de Datos >  >> RDS >> SQLite

Cómo usar ROW_NUMBER en sqlite

Prueba esta consulta

select id, value, (select count(*) from tbl b  where a.id >= b.id) as cnt
from tbl a

VIOLÍN

| id | value | cnt |
--------------------
|  1 |   yes |   1 |
|  3 |   yes |   2 |
|  4 |   yes |   3 |
|  6 |   yes |   4 |
|  9 |   yes |   5 |