[Dbix-class] Re: Join Myself?

2012-07-07 Thread Steve Wells
On Fri, Jul 6, 2012 at 11:33 AM, Steve Wells 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 co

[Dbix-class] Join Myself?

2012-07-06 Thread Steve Wells
I'm trying to convert this SQL statement to DBIC and I'm failing miserably. given: mytable id foreignkey date_added SQL -- select T1.id from mytable T1 left join mytable T2 on (T1.foreignkey = T2.foreignkey and T1.date_added < T2.date_added) where T2.date