[Dbix-class] Joining group of 2 joined tables together
tuco at pasteur.fr
tuco at pasteur.fr
Wed Aug 29 08:57:23 GMT 2012
Hi list,
I am not sure if such complex join has been asked on the list, but I did
not find a similar problem in the archive.
Here are my tables
Table1 Table2
fid (pk) srcfid(pk)
name fid(fk) <- references Table1.fid
start
stop
The SQL query I'd like to translate with DBIx is the following
SELECT * FROM Table1 nt1, Table2 nt2, Table 1 mt1, Table2 mt2
WHERE nt1.fid=nt2.fid AND mt1.fid=mt2.fid AND mt2.srcfid=nt2.srcfid
..... other where conditions.
So my question is, does someone would know how to translate the
particular WHERE clause (mt2.srcfid=nt2.srcfid) ?
Thanks in advance for any clue.
If this is not possible, I'll move to literal SQL using $dbh and $sth.
Regards
Emmanuel
--
-------------------------
Emmanuel Quevillon
tuco at_ pasteur dot fr
-------------------------
More information about the DBIx-Class
mailing list