[Dbix-class] Using 'DISTINCT ON' clause in select statement

Paul Steinkamp steinkam at apple.com
Fri Aug 18 21:49:19 CEST 2006


Greetings,

I'm using postgres as my DB which will accept the clause:

	SELECT DISTINCT ON ( field1, ..., fieldn)    fieldA, fieldB,...  
FROM ....

Note there is no comma after the closing ')' after the 'DISTINCT ON'  
clause. My various attempts either end up not getting it included at  
all or included as a function (and therefore separated from the  
selection field lists by a comma).

Is there a way within the class (short of raw SQL) to perform this  
kind of select?

Thanks,
Paul



More information about the Dbix-class mailing list