count(*)和count(1)和count(id)区别
时间: 2024-04-26 22:26:06 浏览: 70
count(*)、count(1)和count(id)之间的区别在于它们统计的对象不同。count(*)表示统计所有的行数,而count(1)表示统计所有的行数,count(id)表示统计id列的非空值的行数。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [sql语句中count(*),count(1),count(id)区别详解](https://blog.csdn.net/wscrf/article/details/78250189)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
- *2* *3* [MySQL的count(*) ,count(1),count(id)的区别](https://blog.csdn.net/weixin_50966947/article/details/126769434)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文