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

2025-03-22 20:02:57
推荐回答(5个)
回答1:

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

回答2:

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

回答3:

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

回答4:

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

回答5:

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