日期:2014-05-18 浏览次数:20581 次
declare @t table (col1 int,col2 int,col3 int)
insert into @t
select 1,1,1 union all
select 2,2,2 union all
select 3,3,3 union all
select 1,1,1 union all
select 1,2,1 union all
select 2,1,2 union all
select 3,3,3
select * from @t where
col1<>col2 or col1<>col3 or col2<>col3
/*
col1 col2 col3
----------- ----------- -----------
1 2 1
2 1 2
*/
--楼主说了三列是一样的了,那就应该结果是空的。
--3列是一样的,还存3列做什么?