[PHP-users 5321] Re: MySQLでのデータの検索結果
KANAME
php-users@php.gr.jp
Sat, 9 Feb 2002 18:00:21 +0900
ゆーた@初心者です。
> select distinct fuga from hoge;
>
> で、いけるかと・・・・
では、hogeテーブルの fugaフィールドしか表示されませんでした。
テーブル名: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 |
+−−−−−−−+−−−−−−−−−−−−+−−−−−−−−−−−−−−
−−−−−−−−+