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

前端 未结 8 499
情话喂你
情话喂你 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:33

    To get the number of unique titles, you need to pass the DISTINCT clause to the COUNT function as the following statement:

    SELECT
     COUNT(DISTINCT column_name)
    FROM
     'table_name';
    

    Source: http://www.sqlitetutorial.net/sqlite-count-function/

提交回复
热议问题