---
title: "Select Count (*)和Select Count(1)以及Select Count(column)区别"
author: "zerostar88"
date: "2011-03-02T14:57:42Z"
tags: []
categories: ["数据库"]
slug: "select-count-select-count-1-select-count-column"
draft: false
lastmod: "2011-03-02T14:57:42Z"
id: 938292
url: "https://jeffyding.iteye.com/blog/938292"
---

1.  一般情况下，Select Count (\*)和Select Count(1)两者的返回结果是一样的

   2.  假如表沒有主键(PK), 那么count(1)比count(\*)快， 如果有主键PK的話，那count(主键)最快, 如果你的表只有一个字段的话那count(\*)就是最快的

   3. count(\*) 跟 count(1) 的结果一样，都包括对NULL的统计，而count(column) 是不包括NULL的统计