What is the difference between Count(*) and Count(column) - LearnHowToCode SarkariResult.com Interview Questions and Answers LearnHowToCodeOnline
What is the difference between Count(*) and Count(column)

What is the difference between Count(*) and Count(column)

 Count(*) and Count(column)

We use count(*) to get the total number of records.

SQL>select count(*) from emp2;

Note:-There is no difference between count(*) and count(1).

SQL>select count(1) from emp2;

But there is a difference between count(*) and count(column_name) .Count(*) return the total number of records of table and count(column_name) return the count of records that have not null value in that column.

SQL>select count(empno) from emp2;

See the reference screen 

About Mariano

I'm Ethan Mariano a software engineer by profession and reader/writter by passion.I have good understanding and knowledge of AngularJS, Database, javascript, web development, digital marketing and exploring other technologies related to Software development.

0 comments:

Featured post

Political Full Forms List

Acronym Full Form MLA Member of Legislative Assembly RSS Really Simple Syndication, Rashtriya Swayamsevak Sangh UNESCO United Nations E...

Powered by Blogger.