How to get the number of rows of the selected result from sqlite3?

前端 未结 8 516
情话喂你
情话喂你 2020-12-01 12:00

I want to get the number of selected rows as well as the selected data. At the present I have to use two sql statements:

one is

select * from XXX w         


        
8条回答
  •  半阙折子戏
    2020-12-01 12:44

    select (select COUNT(0) 
                from xxx t1 
                where t1.b <= t2.b 
                ) as 'Row Number', b from xxx t2 ORDER BY b; 
    

    just try this.

提交回复
热议问题