2021年4月29日星期四

Count(*) returns null on table with rows present

I have the following query:

SELECT COUNT(*) from (select id, name from table1) as "t" limit 10 offset 10;  

The above returns:

count(*)  ________  

If I run the following:

SELECT * from (select id, name from table1) as "t" limit 10 offset 10;  

6 results.

id      name  1       name1  2       name2  .       .  .       .  .       .  6       name6  

What is going on? I expect to see count(*): 6 because that is the number of rows present in the second query. All I am doing is counting them.

https://stackoverflow.com/questions/67327991/count-returns-null-on-table-with-rows-present April 30, 2021 at 11:57AM

没有评论:

发表评论