Sql With as 用法

Posted on 2015-11-13 12:29  qhy1277  阅读(232)  评论(0)    收藏  举报

            with
district as
(
    select  * from Area where AbbrTW= N'中國'
    union all
    select  a.* from Area a, district b
               where a.AreaNo like '2011%'
)
--district1 as
--(
--    select a.* from district a where a.AreaNo in (select AreaNo from district)   
--)
select * from district

 

参考网址:http://jc-dreaming.iteye.com/blog/772030

博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3