Top "Distinct" questions

The DISTINCT keyword is used to remove duplicate values from a result of a SQL or SPARQL query.

LINQ: Distinct values

I have the following item set from an XML: id category 5 1 5 3 5 4 5 3 5 3 I need a distinct list of these items: 5 1 5 3 5 4 How …

linq distinct
Count the occurrences of DISTINCT values

I am trying to find a MySQL query that will find DISTINCT values in a particular field, count the number …

mysql sql database distinct
MySQL SELECT DISTINCT multiple columns

Let's say I have columns a, b c, d in a table in a MySQL database. What I'm trying to …

mysql sql distinct
How to use LINQ Distinct() with multiple fields

I have the following EF class derived from a database (simplified) class Product { public string ProductId; public string ProductName; public …

c# linq distinct
postgresql COUNT(DISTINCT ...) very slow

I have a very simple SQL query: SELECT COUNT(DISTINCT x) FROM table; My table has about 1.5 million rows. This …

performance postgresql count distinct
How to get distinct results in hibernate with joins and row-based limiting (paging)?

I'm trying to implement paging using row-based limiting (for example: setFirstResult(5) and setMaxResults(10)) on a Hibernate Criteria query that has …

java hibernate paging criteria distinct
SQL: Group by minimum value in one field while selecting distinct rows

Here's what I'm trying to do. Let's say I have this table t: key_id | id | record_date | other_cols 1 | 18 | 2011…

sql group-by max distinct min
How does DISTINCT work when using JPA and Hibernate

What column does DISTINCT work with in JPA and is it possible to change it? Here's an example JPA query …

java jpa distinct
SQL distinct for 2 fields in a database

Can you get the distinct combination of 2 different fields in a database table? if so, can you provide the SQL …

sql distinct
Distinct by property of class with LINQ

I have a collection: List<Car> cars = new List<Car>(); Cars are uniquely identified by their …

c# linq distinct