Welcome Guest, Not a member yet? Register   Sign In
A patch for JOINs
#4

[eluser]champs[/eluser]
We need a one-size-fits-all solution that works *all* the time, so what happens when each row in the table has multiple relationships to the same table?

Code:
<?php
$this->db->select('s.*, t.name AS teachername, p.name AS parentname');
$this->db->from('student AS s');
$this->db->join('adult AS p', 's.parent=p.personid');
$this->db->join('adult AS t', 's.teacher=t.personid');
?>


Messages In This Thread
A patch for JOINs - by El Forum - 07-01-2007, 04:27 AM
A patch for JOINs - by El Forum - 07-01-2007, 08:52 AM
A patch for JOINs - by El Forum - 07-01-2007, 11:28 PM
A patch for JOINs - by El Forum - 07-02-2007, 12:03 AM
A patch for JOINs - by El Forum - 07-02-2007, 12:40 AM



Theme © iAndrew 2016 - Forum software by © MyBB