0

To bulid a Sql query to find the total count of all unique enployee number in a table

2nd Jul 2018, 8:02 AM
Tamil Arasan
Tamil Arasan - avatar
3 Réponses
+ 3
SELECT COUNT (DISTINCT column-name) FROM table-name Taken from here: http://www.dofactory.com/sql/select-distinct
2nd Jul 2018, 8:57 AM
Duncan
Duncan - avatar
+ 1
please explain your questions further. if it is to count all your employee in same table just type "SELECT COUNT(*) AS total FROM tablename"; if there are other users in the table that are not employee. you should have a column that identifies a user as employee u can then write "SELECT COUNT(*) AS total FROM tablename WHERE column_name = identifier";
2nd Jul 2018, 8:11 AM
ADEBAYO DANIEL
ADEBAYO DANIEL - avatar
0
note u can safely omit the AS keyword for brevity
2nd Jul 2018, 8:12 AM
ADEBAYO DANIEL
ADEBAYO DANIEL - avatar