COUNT(*)和COUNT(column)区别
如果指定列名,则 COUNT()函数会忽略指定列的值为空的行,但如果 COUNT()函数中用的是星号(),则不忽略。
下方为测试数据
SELECT COUNT() AS num_cust FROM Customers;
SELECT COUNT(cust_email) AS num_cust FROM Customers;
COUNT(*)和COUNT(column)区别
最新推荐文章于 2024-01-29 00:57:35 发布