悟生慧

 

2010年7月19日

外连接查询

摘要: (表名1:a 表名2:b) select a.a,a.b,a.c,b.c,b.d,b.f from a left out join b on a.a = b.c 阅读全文

posted @ 2010-07-19 15:47 悟生慧 阅读(187) 评论(0) 推荐(0)

拷贝表

摘要: (拷贝数据,源表名:a 目标表名:b) insert into b(a,b,c)select d,e,f from b; 阅读全文

posted @ 2010-07-19 15:45 悟生慧 阅读(142) 评论(0) 推荐(0)

复制表

摘要: (只复制结构,源表名:a 新表名:b) (Access可用)   法一:select * into b from a where 1<>1   法二:select top 0 * into b from a 阅读全文

posted @ 2010-07-19 15:43 悟生慧 阅读(168) 评论(0) 推荐(0)

SQL SERVER中直接循环写入数据

摘要: declare @i intset @i =1while @i<30begininsert into test(userid)values(@i)set @i = @i+1end 阅读全文

posted @ 2010-07-19 15:24 悟生慧 阅读(687) 评论(0) 推荐(0)

SQL触发器

摘要: USE pubs if exists (select name from sysobjects where name='employee_insupd')drop trigger employee_insupdGOcreate trigger employee_insupdon employee -------在employee表中创建触发器for insert,update --------为什... 阅读全文

posted @ 2010-07-19 13:48 悟生慧 阅读(211) 评论(0) 推荐(0)

导航