Re: select distinct with all columns
| From: | leo g. divinagracia iii | Date: | Tue, 13 Aug 2002 19:43:40 +0000 |
| Subject: | Re: select distinct with all columns | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-21124@lists.php.net to get a copy of this message | ||
you maybe using it the wrong way. read the doc:
russ arbuthnot wrote:
> I have a mysql table named "equipment" with 11 columns named: id,
> staff_member, class, type, manufacturer, model, description, picture,
> created, modified, and published.
>
> I'm trying to write a select statement similar to this:
>
> SELECT DISTINCT type FROM equipement WHERE class = "microphones";
>
> yet shows all 11 columns of the selected rows rather than just the
> type column.
>
> The only way I know how to show all the columns is to use SELECT *, or to
> list all the columns manually like "SELECT id, type, class, ... etc."
>
> But when I tried doing this:
>
> SELECT DISTINCT type, id, staff_member, class, manufacturer, model,
> description, picture, created, modified, published FROM equipment WHERE
> class = "microphones";
>
> I just got the exact same answer as if i would have done this:
>
> SELECT * FROM equipment WHERE class = "microphones";
>
> so it didn't help.
>
> Can anyone offer a hint?
> Thanks,
> russ
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
--
Leo G. Divinagracia III
ldivinag@csuhayward.edu