副問い合わせの結果が1列の場合の例は出しましたが、結果が複数列の場合の
例を示します。
以下の例では、saekiさんと年齢と出身地が同じメンバーを抽出します。
| 1 2 3 4 5 6 7 8 | mysql> select * from member where (age, address) = (select age, address from member where name='saeki'); +----+--------+------+--------+---------+ | id | name   | age  | weight | address | +----+--------+------+--------+---------+ | 11 | saeki  |   29 |     49 | 埼玉  | | 12 | ooyama |   29 |     48 | 埼玉  | +----+--------+------+--------+---------+ 2 rows in set (0.00 sec) | 
/
 
  
  
  
  
