SQL Aggregate function count()

In this chapter you will learn:
About function count ()
Syntax of function count ()
Example of function count ()

About function count ()

SQL function count () is used to count the number of values in an expression, either all or distinct. The Count () function can also accept * within parameter but it can only counts the number of rows which is returned by the SQL query.

Syntax of function count ()

SELECT * from count (column_name) from table_name
Or
SELECT count (*) from table_name

Example of function count ()

select 'unique rate' = count (Distinct Rate) from humanresources.employeepayhistory

function count() example
SUMMARY

In this chapter, you have learned about SQL function count (). In the next chapter you will learn about SQL function min () so Click on NEXT button to continue learning.

More Articles

 

Share your thought



PLEASE DISABLE ADBLOCKER AND SUPPORT US!

Please support us by enabling ads on this page. Refresh

YOU DON'T LIKE ADS, WE ALSO DON'T LIKE ADS!
 
But we have to show ads on our site to keep it free and updated. We have to pay huge server costs, domain costs, CDN Costs, Developer Costs, Electricity and Internet Bill. Your little contribution will encourage us to regularly update this site.