首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > Mysql >

请问一个SQL语句

2012-02-03 
请教一个SQL语句!用一条语句从一个表PATHWAY中选出 PATH_ID分解开来就是select PATH_ID from pathway wher

请教一个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)

热点排行