some useful select statement of SQL

来源:互联网 发布:网络电视用不用机顶盒 编辑:程序博客网 时间:2024/05/19 06:39

1. Temporary Table
    select __
    into Temp_Table
    from __
   where__

2. Recursive Select
   with Sub(f1,f2)
   as
  (select f11,f22
   from table1
  where __
  union all
  select f111,f222
  from table2
  where __
 )

3.Multi_table join
  select __
  from (select __ from table1 as A inner join table2 as B on A.f1=B.f1 where __) as C
            right outer join table3 as D on C.f1=D.f1
  where __
  group by __
  order by__

原创粉丝点击