[Dbix-class] Using 'DISTINCT ON' clause in select statement
Brandon Black
blblack at gmail.com
Fri Aug 18 21:55:27 CEST 2006
On 8/18/06, Paul Steinkamp <steinkam at apple.com> wrote:
>
> 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?
Can't the same effect be achieved with GROUP BY?
-- Brandon
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.rawmode.org/pipermail/dbix-class/attachments/20060818/126e3daf/attachment.htm
More information about the Dbix-class
mailing list