How about simply:
select distinct c1, c2 from t
or
select c1, c2, count(*)
from t
group by c1, c2
More Related Contents:
- How do I (or can I) SELECT DISTINCT on multiple columns?
- SQL/mysql – Select distinct/UNIQUE but return all columns?
- Is there any difference between GROUP BY and DISTINCT
- Group by minimum value in one field while selecting distinct rows
- How to use DISTINCT and ORDER BY in same SELECT statement?
- SQL to find the number of distinct values in a column
- Eliminating duplicate values based on only one column of the table
- sql query distinct with Row_Number
- MySQL: Select DISTINCT / UNIQUE, but return all columns?
- Huge performance difference when using GROUP BY vs DISTINCT
- Produce DISTINCT values in STRING_AGG
- How to select records without duplicate on just one field in SQL?
- Select distinct from multiple fields using sql
- SQL query with distinct and sum
- How do I create a parameterized SQL query? Why Should I?
- Auto Increment after delete in MySQL
- Update table values from another table with the same user name
- Using an Alias in a WHERE clause
- How do I delete from multiple tables using INNER JOIN in SQL server
- Does Foreign Key improve query performance?
- SQL Server convert string to datetime
- Script to kill all connections to a database (More than RESTRICTED_USER ROLLBACK)
- SQL speed up performance of insert?
- Error: Column does not exist
- How to Concatenate Numbers and Strings to Format Numbers in T-SQL?
- SQL server identity column values start at 0 instead of 1
- Rails 4 LIKE query – ActiveRecord adds quotes
- How do I view grants on Redshift
- How to Execute SQL Query without Displaying results
- PostgreSQL – dynamic value as table name [duplicate]