Search
 
SCRIPT & CODE EXAMPLE
 

SQL

select count of distinct values sql

SELECT COUNT (DISTINCT column-name)  FROM table-name
Comment

SQL DISTINCT with COUNT

SELECT COUNT(DISTINCT country)
FROM Customers;
Comment

sql select count distinct

select column_name, count(*) AS count FROM table_name GROUP BY column_name;
Comment

PREVIOUS NEXT
Code Example
Sql :: copying query result to excel 
Sql :: SQL Auto Increment Primary Key - SQL Server 
Sql :: oracle sql merge 
Sql :: count characters of string mysql 
Sql :: sql select second max 
Sql :: postgres cast as decimal 
Sql :: identify number of rows in sql 
Sql :: postgres set column based on another column 
Sql :: sql delete row with auto increment 
Sql :: How to check event scheduler status mysql 
Sql :: sqlite truncate tables command 
Sql :: concatenate two strings in sql 
Sql :: add column in sql server 
Sql :: insert current date in mysql 
Sql :: update query in sql server 
Sql :: sql only five first row 
Sql :: sql compare strings 
Sql :: oracle list datafiles 
Sql :: mysql store ip address 
Sql :: replace null value within column mysql 
Sql :: mariadb mysql root access denied 
Sql :: temp table vs variable table in sql server 
Sql :: postgres create column with default value 
Sql :: how to extract only year and month from date in sql 
Sql :: postgres extract day from date 
Sql :: sql count null values in all columns 
Sql :: update join sql 
Sql :: version and edition of SQL Server Database Engine 
Sql :: sqlite unique 
Sql :: postgres update multiple columns 
ADD CONTENT
Topic
Content
Source link
Name
2+6 =