是这样的一个表 表里的日期 住院号 和病区 3个列的数据是一样的。。。其他的列数据不一样。。。我想过滤出 这3列不一样的数据。。。。
跪求大哥们 写一下!
------解决方案--------------------
- SQL code
declare @t table (col1 int,col2 int,col3 int)insert into @tselect 1,1,1 union allselect 2,2,2 union allselect 3,3,3 union allselect 1,1,1 union allselect 1,2,1 union allselect 2,1,2 union allselect 3,3,3select * from @t where col1<>col2 or col1<>col3 or col2<>col3/*col1 col2 col3----------- ----------- -----------1 2 12 1 2*/--楼主说了三列是一样的了,那就应该结果是空的。--3列是一样的,还存3列做什么?