Another Blast from the Past

June 19, 2007 22:01

Revision 111 marks the return of DISTINCT for Query operations. This capability managed to sneak out of the code base long before version 2.0 was released and has been inquired about regularly ever since.

The following two syntax formats are supported.

Query qry = new Query(MyTable.Schema).DISTINCT();

myQuery.IsDistinct = true;


No matter where or many times you specify DISTINCT in your query, it will only appear once in the generated SQL - directly after the SELECT. Even so, it's still possible to create queries that don't execute properly, so be careful what you ask your query for - you might not get it.


3 Comments
Actions: E-mail | Permalink | Comment RSSRSS comment feed

Related posts

Comments

June 21. 2007 06:25

jay

GetRecordCount() return value is not correct.

jay

June 21. 2007 18:01

Eric Kemp

Thanks jay... you're absolutely right. I've fixed this for my next check in (after Rev 114). In addition, I've added DISTINCT support to:

GetCount()
GetAvg()
GetSum()

Didn't add it to GetMin() and GetMax(), because I can't imagine a scenario where DISTINCT would change the result... Smile

Eric Kemp

June 27. 2007 11:18

Thanks for fixing it! Wink

Elmar

Comments are closed