Sql With as 用法

Posted on 2015-11-13 12:29  qhy1277  阅读(226)  评论(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

Copyright © 2024 qhy1277
Powered by .NET 8.0 on Kubernetes