[CDBI] coding a join

Thomas Charron twaffle at gmail.com
Sun Apr 15 01:34:23 BST 2007


See has_many

On 4/14/07, Arshavir Grigorian <grigorian at gmail.com> wrote:
> Hi,
>
> I have 2 tables - "person" and "contact" where each person can have many
> contacts. I would like to code the following SQL into Class::DBI:
>
> select max(c.create_dt)
>   from person p, contact c
> where p.c_id = c.id
>    and p.id = ?
>
> I think I need set_sql() but since Class::DBI expects the set_sql() query to
> return a primary key, I am not sure how to proceed.

-- 
-- Thomas



More information about the ClassDBI mailing list