Search
 
SCRIPT & CODE EXAMPLE
 

SQL

SQL Count UNIQUE Rows

SELECT COUNT(DISTINCT country)
FROM Customers;
Comment

sql count unique values in one column

you can use this to check the count of unique items in a column:
SELECT COUNT(DISTINCT column_name) AS some_alias FROM table_name
Comment

PREVIOUS NEXT
Code Example
Sql :: MySQL server is running with the –secure-file-priv 
Sql :: Query the list of CITY names starting with vowels (i.e., a, e, i, o, or u) from STATION. Your result cannot contain duplicates. 
Sql :: sql merge 
Sql :: date to string mariadb 
Sql :: how to get the date diff on once field in sql server 
Sql :: Assign value to var in SQL 
Sql :: is not numeric sql 
Sql :: mysql subdate 
Sql :: inner join sql oracle 
Sql :: cannot drop database because it is currently in use 
Sql :: sql compare two tables for differences 
Sql :: sql query to list all tables in a database sql server 
Sql :: how to check the mysql version mac 
Sql :: insert current date sql 
Sql :: create sequence postgres 
Sql :: mysql clear screen 
Sql :: delete row psql 
Sql :: create index mysql cli 
Sql :: select last 30 days sql 
Sql :: greater than in mongodb query 
Sql :: mysql failed to login as root@localhost 
Sql :: sql any 
Sql :: how to drop function in sql 
Sql :: SQL NOT BETWEEN Operator 
Sql :: get records in sql according to month name and count 
Sql :: multiple like in sql 
Sql :: sql running total 
Sql :: sql update insert and delete 
Sql :: how to access to mysql without root 
Sql :: drop a view in sqlite 
ADD CONTENT
Topic
Content
Source link
Name
9+9 =