About 5,290,000 results
Open links in new tab
  1. How to select unique records by SQL - Stack Overflow

    DISTINCT keyword is supposed to be applied to all the columns in the select query and not just to the column next to which DISTINCT keyword is written. So, basically, it means that every row returned in …

  2. Using DISTINCT along with GROUP BY in SQL Server

    Is there any purpose for using both DISTINCT and GROUP BY in SQL? Below is a sample code SELECT DISTINCT Actors FROM MovieDetails GROUP BY Actors Does anyone know of any …

  3. sql - LISTAGG in Oracle to return distinct values - Stack Overflow

    I am trying to use the LISTAGG function in Oracle. I would like to get only the distinct values for that column. Is there a way in which I can get only the distinct values without creating a functi...

  4. SQL to find the number of distinct values in a column

    SELECT COUNT(DISTINCT column_name) AS some_alias FROM table_name This will count only the distinct values for that column.

  5. Using the distinct function in SQL - Stack Overflow

    3 I have a SQL query I am running. What I was wanting to know is that is there a way of selecting the rows in a table where the value in on one of those columns is distinct? When I use the distinct …

  6. sql - How to use DISTINCT and ORDER BY in same SELECT statement ...

    So, thanks to the SQL standard extended sort key column feature, it is totally possible to order by something that is not in the SELECT clause, because it is being temporarily added to it behind the …

  7. How do I (or can I) SELECT DISTINCT on multiple columns?

    Sep 10, 2008 · 30 The problem with your query is that when using a GROUP BY clause (which you essentially do by using distinct) you can only use columns that you group by or aggregate functions. …

  8. sql server - SELECT DISTINCT on one column - Stack Overflow

    1 FOO-23 Orange 3 FOO-24 Apple This query isn't getting me there. How can I SELECT DISTINCT on just one column?

  9. sql - How to Select Every Row Where Column Value is NOT Distinct ...

    I need to run a select statement that returns all rows where the value of a column is not distinct (e.g. EmailAddress). For example, if the table looks like below: CustomerName EmailAddress A...

  10. sql - DISTINCT clause with WHERE - Stack Overflow

    How can I use the DISTINCT clause with WHERE? For example: SELECT * FROM table WHERE DISTINCT email; -- email is a column name I want to select all columns from a table with distinct …