The count()
function counts rows, and is very often used as count(*)
. If I had a table with phoneNo and firstName, count(phoneNumber)
returns the same number as count(*)
. All columns are always present, if not populated, in each row.
There is a subtle difference.
If you specify a field , count(fieldname) will count records which have non null values for the field. count(*) will give you total rows.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With