What does “select count(1) from table_name” on any database tables mean?

前端 未结 9 600
被撕碎了的回忆
被撕碎了的回忆 2020-12-22 18:38

When we execute select count(*) from table_name it returns the number of rows.

What does count(1) do? What does 1 signify here

9条回答
  •  眼角桃花
    2020-12-22 19:15

    Difference between count(*) and count(1) in oracle?

    count(*) means it will count all records i.e each and every cell BUT

    count(1) means it will add one pseudo column with value 1 and returns count of all records

提交回复
热议问题