sql如何用with as的结果作where条件

2025-03-20 17:12:45
推荐回答(1个)
回答(1):

示例代码如下:

;with a as(select * from table_a),
b as (select * from a where id in(3,4,5))
select * from b

记得一定要有逗号间隔开两个查询,最后一个查询前是没有逗号的