sql優化——count(1)、count(*)與count(列名)的區別

1、從執行效果來看 1. count(1) and count(*):spa 基本沒差異效率 count(*)包括了全部的列,至關於行數,在統計結果的時候,不會忽略NULLselect 2. count(1) and count(列名):統計 (1) count(1) 會統計表中的全部的記錄數,不會忽略NULL,包含字段爲null 的記錄。co (2) count(列名) 會統計該列字段在表中出現
相關文章
相關標籤/搜索