WITH AS 用法 SQL表、结果别名


with
cte1 as
(
    select * from table1 where name like 'abc%'
),
cte2 as
(
    select * from table2 where id > 20
),
cte3 as
(
    select * from table3 where price < 100
)
select a.* from cte1 a, cte2 b, cte3 c where a.id = b.id and a.id = c.id



http://www.cnblogs.com/xiufengd/p/4739269.html

你可能感兴趣的:(WITH AS 用法 SQL表、结果别名)