get row number along results from a sqlite query

I am doing

sqlite file.db "select ... " | nl

To number every row in the resultset. How do I get rid nl ? in other words, how do I do it in sql ?


What about

SELECT ROWID,* FROM ...;

Or try ROW_NUMBER() if you're on SQLite v. 3.25.0 or higher See How to use ROW_NUMBER in sqlite