嵌套就可以了。 select * from ( select * from 表 )t where v...主要你这个不具体。大体就这样写。
select *from aa where 字段 in (select 字段 from bb where ...)
--就用直接使用派生表罗 你可以给一个表或复杂表引用一个临时的名字,用于在后面的处理过程中引用那些派生的表。 这样做叫做表别名。 要创建一个表别名,我们可以写: FROM table_reference AS alias 或者 FROM table_reference alias AS 关键字是噪音。 alias 可以是任意标识符。
from
(
select *
from table1
)a
from @table(也可以是个表变量)
select *
from
(
select *
from 表
)t
where v...主要你这个不具体。大体就这样写。
(select 字段 from bb where ...)
你可以给一个表或复杂表引用一个临时的名字,用于在后面的处理过程中引用那些派生的表。 这样做叫做表别名。 要创建一个表别名,我们可以写: FROM table_reference AS alias
或者 FROM table_reference alias
AS 关键字是噪音。 alias 可以是任意标识符。
select *
from
(
select *
from 表
)t