Welcome to collectivesolver - Programming & Software Q&A with code examples. A website with trusted programming answers. All programs are tested and work.

Contact: aviboots(AT)netvision.net.il

Prodentim Probiotics Specially Designed For The Health Of Your Teeth And Gums

Instant Grammar Checker - Correct all grammar errors and enhance your writing

Teach Your Child To Read

Powerful WordPress hosting for WordPress professionals

Disclosure: My content contains affiliate links.

31,106 questions

40,778 answers

573 users

How to use SQL COUNT() Function in MySQL

Learn & Practice SQL


302 views
asked Sep 29, 2015 by avibootz
edited Oct 12, 2015 by avibootz

3 Answers

0 votes
-- NULL values in Salary column will not be counted

SELECT COUNT(Salary) FROM workers

 





answered Sep 29, 2015 by avibootz
0 votes
-- Count unique values

SELECT COUNT(DISTINCT Salary) FROM workers

 





answered Sep 29, 2015 by avibootz
0 votes
-- Use alias as the result column title

SELECT COUNT(Salary) AS TotalSalaries FROM workers

 





answered Sep 29, 2015 by avibootz

Related questions

3 answers 212 views
2 answers 186 views
2 answers 182 views
1 answer 171 views
...