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

posted @ 2015-09-17 17:10  游子善心  阅读(1)  评论(0编辑  收藏  举报  来源