日期:2014-05-16  浏览次数:20763 次

请教一个SQL语句!
用一条语句从一个表PATHWAY中选出 PATH_ID

  分解开来就是
   
  select PATH_ID from pathway where content = 'a'


  select PATH_ID from pathway where content = 'b'


  找出相同的所有PATH_ID。
 

------解决方案--------------------
mysql> select t1.p from (select path_id p from pathway where content = 'a') t1, (select path_id p from pathway where content='b') t2 where t1.p = t2.p;
+------+
| p |
+------+
| 2 |
+------+
1 row in set (0.00 sec)