Re: DB_DataObject Joins
| From: | David Sanders | Date: | Mon, 14 May 2007 04:49:38 +0000 |
| Subject: | Re: DB_DataObject Joins | ||
| References: | 1 2 3 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-27283@lists.php.net to get a copy of this message | ||
Noel da Costa wrote:
Can I create a join on the same table? For example: $m =& DB_DataObject::factory('person'); $m->selectAdd(); $m->selectAdd('distinct email'); $f =& DB_DataObject::factory('person'); $m->joinAdd($f); ... so I'm trying to eliminate duplicate emails and then still return all the fields from that table. Ideas?1.) Yes you should be able to join on the same table, but: 2.) Use 'group by' instead of select distinct as an easier way to remove duplicates and retain the full select -- David Sanders shangxiao