SQL statement count (1) count (*) difference count (field) usage (rpm)

SQL statement count (1) the difference between count (*) count (field) usage

In the SQL statement count function is one of the most commonly used functions, count function is a function used to record the number of statistical tables,

A difference. Count (1) and count (*) of

1. count (1) and count (*) role:

Number of all rows are look-up table, regardless of whether it contains a null value.

2. Distinction: But count (1) (*) higher than count efficiency

II. Distinction count (field) and the count (. 1), and count (*) in the

Action count (field) is non-empty rows in this table retrieval field, this field is null count is not recorded

Guess you like

Origin www.cnblogs.com/havain/p/10978291.html