oracle可以这样定义内存表:
with t as(
     select null as c from dual
)
select * from t这样的语句,在SQLSERVER应该怎么样写呢?谢谢!

解决方案 »

  1.   

    sqlserver 叫中间表
    也是这样
    xxx;
    with t as (
     select null as c from dual
    )
    select * from t;
      

  2.   


    --SQL2005及以上版本可以用cte写法;with cte as
    (
        select ... from ... where ... group by ... order by ...
    )select ...
    from cte 
    where ...
      

  3.   

    楼主具体可以看看SQL2005  with cte 的用法!
      

  4.   

    with cte as 是公用表表达式。
      

  5.   

      
     sqlserver05以上一样有