Skip to content Skip to sidebar Skip to footer
Showing posts with the label Distinct

Sqlalchemy With Postgres. Try To Get 'distinct On' Instead Of 'distinct'

I need to generate query like this: SELECT **DISTINCT ON** (article.code) article.code, article.ti… Read more Sqlalchemy With Postgres. Try To Get 'distinct On' Instead Of 'distinct'

Postgresql - Select Distinct(column1, Column2) Where A Condition Holds

I have the following table and some sample records in it: id | attr1_id | attr2_id | user_i… Read more Postgresql - Select Distinct(column1, Column2) Where A Condition Holds

How To Do A Select Distinct Equivalent For A Page Filter In Nhibernate?

Lets say you are working in SQL 2005 with a copy of Northwind database installed. Your working on a… Read more How To Do A Select Distinct Equivalent For A Page Filter In Nhibernate?

Combining Select Distinct With Union Distinct In Mysql - Any Effect?

The following two SQL statements are functionally identical: SELECT DISTINCT a,b,c FROM table1 UNIO… Read more Combining Select Distinct With Union Distinct In Mysql - Any Effect?

Sql Select Distinct Column And Latest Date

I'm looking to select just the latest records of a table based on date, but only one one Distin… Read more Sql Select Distinct Column And Latest Date

Distinct Values From An Array?

Following tables: CREATE TEMPORARY TABLE guys ( guy_id integer primary key, guy text ); CREATE TEMP… Read more Distinct Values From An Array?

How To Get Rows For N Distinct Values Of A Column

I need to get rows for n distinct invoice numbers. I have SELECT query that gives me results from t… Read more How To Get Rows For N Distinct Values Of A Column

Is It Possible To Optimize Query Using The Exists Instead Of In Clause With Distinct

I have query which works. select contract_no AS c_no, cm_mac AS c_mc, MIN(tstamp) as time2, sum(1) … Read more Is It Possible To Optimize Query Using The Exists Instead Of In Clause With Distinct