一条SQL语句中可否有多个select 或where

如题所述

        一条sql语句是可以有多个select或者where的,具体示例如下:

     select a.id form tablea as a  where a.id in (select b.id from tableb as b where b.id='1');

  这样这条sql语句就包含了多个select和where了,需要注意的是在一个select字句里面不能有多个where存在。

温馨提示:内容为网友见解,仅供参考
第1个回答  2007-04-19
可以的。例如:select a.xm from f_gr a where a.bh=(select b.bh from b_xx b where b.bz is null )本回答被提问者采纳
第2个回答  2007-04-19
要看怎么写了
子查询是可以的
select * from (select * from tableA where ...) a,(select * from tableB where ....)b where.....
第3个回答  2007-04-19
在你能看懂的能力范围内任意个
在你的电脑运行能力范围内无数个
第4个回答  2007-04-19
N个,看你喜欢了,不过超过3个就不太好辨认了。
相似回答