码迷,mamicode.com
首页 > 数据库 > 详细

Sql With as 用法

时间:2015-11-13 13:02:55      阅读:221      评论:0      收藏: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

Sql With as 用法

标签:

原文地址:http://www.cnblogs.com/qhy1277/p/4961789.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!