![]() |
|
Welcome to the Computer Webmaster Gaming Console Graphics Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact us. |
| |||||||
| Pear Pear programming, this is a very complex subject as with using pear with php can be a difficult task for some, so lets talk pear. |
![]() |
| | LinkBack | Thread Tools | Display Modes |
| | #1 | ||
| Hi all, Quick quizzle about DB_DataObject Joins... 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? Thanks, Noel Noel da Costa Lead Developer Magnet Harlequin T: 01895 432400 M: 07879 427940 F: 01895 432444 E: noel.dacosta@magharl.co.uk W: http://www.magharl.co.uk This e-mail is intended solely for the addressees named above and any other use is prohibited. Access to this email by anyone else is unauthorised. It may contain confidential information. If you have received this e- mail in error, please contact the sender by return e-mail. We do not accept legal responsibility for the contents of this message if it has reached you via the internet. Any opinions expressed are those of the author and are not necessarily endorsed by the company. Recipients are advised to apply their own virus check to this message and all incoming e-mail on delivery. | |||
| | #2 | ||
| 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 | |||
| Featured Websites | ||||
|
![]() |
| Tags: db_dataobject, joins |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| Featured Websites | ||||
|