We have 6 records in our table you can see it in below screen.
COUNT(*)
Count(*) gives the total number of records in a table.
I have used here count(*) and we are getting output 6.
COUNT(Fieldname)
If we are using COUNT(Fieldname) it will give total number of records but it will exclude null
values from result.
Here i am using COUNT(Location) it means output should be 4.
It is exactly what coming you can see in below screen.
COUNT(1)
There is nothing difference between COUNT(*) and COUNT(1).
See output below
That’s it.
Enjoy Reading.
No comments:
Post a Comment