Question : Below is an example of my customer table. There some records having multiple values in BIRTHDAY DATE (by […]
Tag: distinct
Fastest query for distinct IDs in a many-to-many relationship
Question : I have this table in PostgreSQL 9.4: CREATE TABLE user_operations( id SERIAL PRIMARY KEY, operation_id integer, user_id integer […]
LEFT JOIN confusion
Question : I am having issues with this simple scenario. I’m probably missing some basic concept… I have 2 tables, […]
Grouping Data Using Joined Tables with Certain Distinct Values
Question : I am struggling to get my head around how to do this so please bare with me while […]
Best performance to get distinct values for a given key from a big table
Question : Given a table like so: CREATE TABLE attr (user_id uuid, key text, value text); with indexes on key […]
Postgresql: very slow results with “group by”
Question : I am trying fix some severe performance issues on codechecker. Issue reported here: https://github.com/Ericsson/codechecker/issues/1399#issuecomment-368862492 The table is the […]
How to create aggregate function, like sum, with an implicit DISTINCT?
Question : We have an ERP system which allows aggregates to be used (eg SUM(foo)) but not with DISTINCT (eg […]
Is there a way to speed up a DISTINCT query?
Question : I have a table t in a database (PostgreSQL 10.4): d t; Table “public.t” Column | Type | […]
Is a UNION query equivalent with or without DISTINCT in subqueries?
Question : Consider the following two queries. SELECT Col1, Col2 FROM TblA UNION SELECT Col1, Col2 FROM TblB and SELECT […]
Need to Bring Back most Recent Departure Date from Sales table for Customers in Recipient table
Question : Looking at 3 Tables – Recipient, HouseholdScores, Sales. I need to bring back the most Recent tsDepart (departure […]