[Dbix-class] Re: Join Myself?

Steve Wells wells at cedarnet.org
Sun Jul 8 02:43:36 GMT 2012


On Fri, Jul 6, 2012 at 11:33 AM, Steve Wells <wells at cedarnet.org> wrote:
> I'm trying to convert this SQL statement to DBIC and I'm failing miserably.

Let me clarify a bit…

Given this setup:

http://stackoverflow.com/questions/1313120/retrieving-the-last-record-in-each-group

it is possible to convert the SQL statement:

SELECT m1.*
FROM messages m1 LEFT JOIN messages m2
 ON (m1.name = m2.name AND m1.id < m2.id)
WHERE m2.id IS NULL;

to DBIx::Class.

I have read the manual / tutorials etc but it doesn't seem possible to
add and extras (i.e. m1.id < m2.id) to your join command.

Is this true?



More information about the DBIx-Class mailing list