Home > Archive > PHP DB > June 2006 > RE: [PHP-DB] Select distinct field won't return distinct value
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
RE: [PHP-DB] Select distinct field won't return distinct value
|
|
| Blanton, Bob 2006-06-17, 8:04 am |
| It is a Sybase vendor function but I was wondering if mysql had
something comparable. I don't see anything in the manual. Maybe the
subquery is the only way to go.
-----Original Message-----
From: Chris [mailto:dmagick@gmail.com]=20
Sent: Wednesday, June 07, 2006 8:50 AM
To: Blanton, Bob
Cc: php-db@lists.php.net
Subject: Re: [PHP-DB] Select distinct field won't return distinct value
Blanton, Bob wrote:
> I'm just learning MySQL so don't know all the syntax. There is a
"LIST"
> function in Sybase Adaptive Server Anywhere which would do that. Is
> there an equivalent function in MySQL?
>=20
> Query:
> SELECT distinct niin, list(serial_number) FROM
> fmds.maintenance_equipment
> group by niin
> order by niin
>=20
> Output:
> niin list(serial_number)
> 000213909 B71-11649,B71-11657,B71-11650
> 000473750 BAF-3750-0001,BAF-3750-0002,BAF-3750-0003
> 000929062 2341
> 001139768 2207
Pretty sure that's a sybase specific function. Nothing like that exists=20
in mysql or postgresql.
--=20
Postgresql & php tutorials
http://www.designmagick.com/
| |
| Martin Alterisio 2006-06-17, 8:04 am |
| I have a friend called GROUP_CONCAT, he may know what you want but he's only
available since MySQL 4.1
2006/6/7, Blanton, Bob <BlantonB@mmcs.army.mil>:
>
> It is a Sybase vendor function but I was wondering if mysql had
> something comparable. I don't see anything in the manual. Maybe the
> subquery is the only way to go.
>
>
> -----Original Message-----
> From: Chris [mailto:dmagick@gmail.com]
> Sent: Wednesday, June 07, 2006 8:50 AM
> To: Blanton, Bob
> Cc: php-db@lists.php.net
> Subject: Re: [PHP-DB] Select distinct field won't return distinct value
>
> Blanton, Bob wrote:
> "LIST"
>
> Pretty sure that's a sybase specific function. Nothing like that exists
> in mysql or postgresql.
>
> --
> Postgresql & php tutorials
> http://www.designmagick.com/
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
|
|
|
|
|