- How to get distinct values from 2 columns in SQL?
- Can I use distinct with multiple columns?
- How to get distinct values of all columns in SQL?
- How to get distinct count of multiple columns in Oracle?
How to get distinct values from 2 columns in SQL?
To select distinct values in two columns, you can use least() and greatest() function from MySQL.
Can I use distinct with multiple columns?
Yes, DISTINCT works on all combinations of column values for all columns in the SELECT clause.
How to get distinct values of all columns in SQL?
To get unique or distinct values of a column in MySQL Table, use the following SQL Query. SELECT DISTINCT(column_name) FROM your_table_name; You can select distinct values for one or more columns.
How to get distinct count of multiple columns in Oracle?
but when we want to count distinct column combinations, we must either clumsily concatenate values (and be very careful to choose the right separator): select count(distinct col1 || '-' || col2) from mytable; or use a subquery: select count(*) from (select distinct col1, col2 from mytable);