Re: Where to learn about these topics
| From: | John Nichel | Date: | Mon, 22 Nov 2004 17:50:01 +0000 |
| Subject: | Re: Where to learn about these topics | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-202688@lists.php.net to get a copy of this message | ||
Chris Lott wrote:
Right-- but my question isn't about the query, but about the results. Again, look at my result set: +---------+----------+----------+-----------+-------+Look at the MySQL documentation for 'DISTINCT' and 'GROUP BY' -- John C. Nichel ÜberGeek KegWorks.com 716.856.9675 john@kegworks.com| first | last | relation | city | state |+---------+----------+----------+-----------+-------+| Chris | Beks | business | Fairbanks | AK | | Robert | Hannon | friend | Fairbanks | AK | | Cindy | Lott | family | Fresno | CA | | Derryl | Hartz | business | Seattle | WA | | Kirsten | O'Malley | friend | Seattle | WA |+---------+----------+----------+-----------+-------+ I want an output routine that does this: CITY person person CITY person CITY person There has to be a more elegant way than making a new query for each city-- which is what the query I mentioned above fixes... but is the kind of code I have put, with its ugly indexes and counters really the best way? This is another area where books always stop at the simplest cases...