Top "Distinct" questions

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

SqlAlchemy: count of distinct over multiple columns

I can't do: >>> session.query( func.count(distinct(Hit.ip_address, Hit.user_agent)).first() TypeError: distinct() …

postgresql count sqlalchemy distinct aggregate-functions
Javascript json data grouping

Sorry if this has been asked before, but I couldn't find a good example of what I'm trying to accomplish. …

javascript jquery grouping distinct
DISTINCT ON in an aggregate function in postgres

For my problem, we have a schema whereby one photo has many tags and also many comments. So if I …

sql json postgresql distinct aggregate-functions
Adding DISTINCT to a UNION query

How do I get distinct title.id's from this: SELECT Title.id, Title.title FROM titles as Title HAVING points &…

mysql sql union distinct union-all
Howto merge 2 Django QuerySets in one and make a SELECT DISTINCT

models.py class SinglePoint(models.Model): attributes = models.TextField(blank=True) name = models.CharField(max_length=100) geom = models.PointField() #Kartenposition …

django distinct geodjango django-queryset
Select top distinct results ordered by frequency

My table has two columns: id and name. The data looks like this: id | name ---------- 1 Jeff 2 Sam 3 Carl 4 Sam 5 …

sql mysql count distinct
Oracle SQL - How to get distinct rows using RANK() or DENSE_RANK() or ROW_NUMBER() analytic function?

I am looking to get the top 3 distinct salaries of each department. I was able to do it either using …

sql oracle distinct rank
C# LINQ counting elements with DISTINCT

I have a collection of KeyValuePair items with DateTime as key and a string as value. Basically my data looks …

c# linq distinct key-pair
SQL Select Into Field

I want to accomplish something of the following: Select DISTINCT(tableA.column) INTO tableB.column FROM tableA The goal would …

sql distinct select-into
PostgreSQL: Select only the first record per id based on sort order

For the following query I need to select only the first record with the lowest shape_type value (ranges from 1 …

sql postgresql distinct greatest-n-per-group distinct-on