问题是这样的:
在数据库中一些记录相同的,当我修改一条记录的时候,它就生成一条新的记录,只是被修改的列不同了,我现在要做的就是把这些被修改的列找出来
比如:
1. a,b,c,d
2. a,b,c,d
3. a,b,c,d
4. e,e,e,e
现在我修改了第3行数据 : a,b,c,e 于是新增加一条记录
变为:
1. a,b,c,d
2. a,b,c,d
3. a,b,c,d
4. a,b,c,e
5. e,e,e,e问题是:我怎么找出发生变化的这一列呢?也就是新增加的第四列

解决方案 »

  1.   

    select * from table2 a where not exists(select * from table1 b where a.column1=b.column1 and a.column2=b.column2 and a.column3=b.column3  and a.column4=b.column4) 
      

  2.   

    1楼要看清楚了,不是你这样ctrl +v ctrl +c 的,是一张表
      

  3.   

    增加2个字段的
      ID             原ID
       1,A,B,C,D  
       2,A,B,C,D
       3,A,B,C,D
       4,A,B,C,E,3
       5,E,E,E,E
      

  4.   

    获取插入的行-SqlServer2005insert into table1
    output inserted.column1,inserted.column2
    values (1,2)--returns
    column1   column2
    1             2