Top "Distinct" questions

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

mysql query: SELECT DISTINCT column1, GROUP BY column2

Right now I have the following query: SELECT name, COUNT(name), time, price, ip, SUM(price) FROM tablename WHERE time &…

mysql select group-by distinct
Distinct pair of values SQL

Consider create table pairs ( number a, number b ) Where the data is 1,1 1,1 1,1 2,4 2,4 3,2 3,2 5,1 Etc. What query gives me the distinct values …

sql group-by distinct
GROUP BY and COUNT in PostgreSQL

The query: SELECT COUNT(*) as count_all, posts.id as post_id FROM posts INNER JOIN votes ON votes.post_…

sql postgresql count distinct aggregate-functions
Eliminating duplicate values based on only one column of the table

My query: SELECT sites.siteName, sites.siteIP, history.date FROM sites INNER JOIN history ON sites.siteName = history.siteName ORDER …

sql sql-server distinct inner-join duplicate-removal
MongoDB distinct aggregation

I'm working on a query to find cities with most zips for each state: db.zips.distinct("state", db.zips.…

mongodb distinct
how to use distinct in ms access

I have two tables. Task and Categories. TaskID is not a primary key as there are duplicate values.When there …

sql ms-access distinct ms-access-2003
LINQ Select Distinct with Anonymous Types

So I have a collection of objects. The exact type isn't important. From it I want to extract all the …

c# linq distinct anonymous-types equality
Postgres: Distinct but only for one column

I have a table on pgsql with names (having more than 1 mio. rows), but I have also many duplicates. I …

postgresql select distinct
SQL query with distinct and sum

I have the following medleys table that combines colors, fruits and ratings: [medleys] medley_id | color | fruit | rating ============================================== 1 red apple 25 2 …

sql sum distinct ansi-sql
How do I SUM DISTINCT Rows?

I'm struggling with a query where I need to SUM DISTINCT Rows. There has to be a way to do …

sql sum row distinct rows