Back to Browse

difference between count(emp id) and count (e.name)

5 views
May 14, 2026
2:18

When I was studying SQL, the difference between count(e.emp_id) and count(e.name) didn't feel that huge. But, once you get into the system, you understand that - it is always better to count using the primary key or COUNT(*)/(1). These count all the rows including the null values which count(temp_name) would skip! Seems like a tiny detail but, when on a large volume of data, has a great impact. Remember count(PRIMARY KEY) over count(any other column) Thank you for 332 subs! I will be posting another video on SQL in this week so, subscribe if you haven't already!

Download

0 formats

No download links available.

difference between count(emp id) and count (e.name) | NatokHD