DB_DataObject joinAdd
| From: | Muhyiddin A.M Hayat | Date: | Wed, 22 Dec 2004 16:18:34 +0000 |
| Subject: | DB_DataObject joinAdd | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-16447@lists.php.net to get a copy of this message | ||
Dear all,
I have problem with joinAdd().
I Have 2 tables
Employee:
code | name
-------+----------
GL001 | Mr. Black
SL001 | Mr. Brown
SL001 | Mr. White
Depts:
code | name
------+---------
GL | General
SL | Sales
So, I would like to create sql like below using DB_DataObject
SELECT
employee.code,
employee.name,
dept.name AS dept
FROM
employee
LEFT JOIN dept ON (substring(employee.code from 1 for 2) = dept.code)
I don't know how to join them using DB_DataObject