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

来源:百度知道 编辑:UC知道 时间:2024/05/31 01:24:01

        一条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存在。

可以的。例如:select a.xm from f_gr a where a.bh=(select b.bh from b_xx b where b.bz is null )

要看怎么写了
子查询是可以的
select * from (select * from tableA where ...) a,(select * from tableB where ....)b where.....

在你能看懂的能力范围内任意个
在你的电脑运行能力范围内无数个

N个,看你喜欢了,不过超过3个就不太好辨认了。