Why does count(*) and count(1) return different results ? | Sololearn: Learn to code for FREE!
¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita
+ 2

Why does count(*) and count(1) return different results ?

19th Jul 2016, 8:29 AM
Ashutosh Singh
2 Respuestas
+ 2
count(1) will return only 1 whereas count(*) counts all the values satisfying
19th Jul 2016, 4:47 PM
manish rawat
manish rawat - avatar
0
count ignores null values unless you use * which just counts the rows regardless of values.
22nd Jul 2016, 5:37 PM
Saurabh Joshi
Saurabh Joshi - avatar