On Fri, Jul 6, 2012 at 3:33 PM, Steve Wells wrote:
>
> I'm trying to convert this SQL statement to DBIC and I'm failing miserably.
Not a lot of magic required, see 'Joining to the same table twice' in
http://search.cpan.org/dist/DBIx-Class/lib/DBIx/Class/Manual/Joining.pod
For joining a table t
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