摘要: SQLServer2005通过intersect,union,except和三个关键字对应交、并、差三种集合运算详细如下use tempdb go if (object_id ('t1' ) is not null ) drop table t1 if (object_id ('t2' ) is not null ) drop table t2 go create table t1 (a int ) insert into t1 select 1 union select 2 union select 3 create table t2 (a int ) ins 阅读全文
posted @ 2013-09-27 16:50 点滴成事 阅读(322) 评论(0) 推荐(0) 编辑
摘要: select S_ID,P_ID,P_Url,Users from (select S_ID,P_ID,P_Url from T_Test) A outer apply--右加字段给主表(select Users =Replace(Replace((select U_User a from R_Te... 阅读全文
posted @ 2013-09-27 09:58 点滴成事 阅读(199) 评论(0) 推荐(0) 编辑