[PHP-users 5322] Re: MySQLでのデータの検索結果
kz
php-users@php.gr.jp
Sat, 9 Feb 2002 18:39:18 +0900
SELECT ID,NAME,URL FROM TEST GROUP BY NAME でいいんじゃないですか?
詳しくはhttp://www.mysql.gr.jp/
などで調べてください。ここはphpメーリングリストですから。
>
> テーブル名:TEST
> +−−−−−−−+−−−−−−−−−−−−+−−−−−−−−−−−−−−
> −−−−−−−−+
> |ID |NAME |URL
> |
> +−−−−−−−+−−−−−−−−−−−−+−−−−−−−−−−−−−−
> −−−−−−−−+
> |000001 |あいうえお |http://
> www.xxx.com/a |
> |000002 |あいうえお |http://
> www.xxx.com/b |
> |000003 |かきくけこ |http://
> www.xxx.com/c |
> |000004 |さしすせそ |http://
> www.xxx.com/d |
> |000005 |たちつてと |http://
> www.xxx.com/e |
> |000005 |さしすせそ |http://
> www.xxx.com/f |
> +−−−−−−−+−−−−−−−−−−−−+−−−−−−−−−−−−−−
> −−−−−−−−+
>
> からNAMEで重複するものを一つにして以下のように抽出したいのです。
> +−−−−−−−+−−−−−−−−−−−−+−−−−−−−−−−−−−−
> −−−−−−−−+
> |ID |NAME |URL
> |
> +−−−−−−−+−−−−−−−−−−−−+−−−−−−−−−−−−−−
> −−−−−−−−+
> |000001 |あいうえお |http://
> www.xxx.com/a |
> |000003 |かきくけこ |http:/
> /www.xxx.com/c |
> |000004 |さしすせそ |http://
> www.xxx.com/d |
> |000005 |たちつてと |http://
> www.xxx.com/e |
> +−−−−−−−+−−−−−−−−−−−−+−−−−−−−−−−−−−−
> −−−−−−−−+