table是表名 
里面有 
id  conditionPary_id  condition_id
1      0                  1
2      1                  1
3      2                  3
4      5                  5
找出这个表里的 conditionPary_id  condition_id
 这两个字段记录不同的数据来 
要结果是  
id  conditionPary_id  condition_id
1      0                  1
3      2                  3

解决方案 »

  1.   

    select * from table where conditionpary_id<>condition_id
      

  2.   

    table是表名  
    里面有  
    id  conditionPary_id  condition_id 
    1      0                  1 
    2      1                  1 
    3      2                  3 
    4      5                  5 
    找出这个表里的 conditionPary_id  condition_id 
     这两个字段记录不同的数据来  
    要结果是   
    id  conditionPary_id  condition_id 
    1      0                  1 
    3      2                  3 select * from tb where conditionPary_id <> condition_id 
      

  3.   

    select * from tb 
    where conditionPary_id<>condition_id
      

  4.   

    declare @tb table (id int,conditionPary_id int,condition_id int)
    insert into @tb select 1,0,1
    insert into @tb select 2,1,1
    insert into @tb select 3,2,3
    insert into @tb select 4,5,5select * from @tb t
    where conditionPary_id<>condition_idselect * from @tb t
    where conditionPary_id<>condition_id
      

  5.   

       用convert转换在判断吧
      

  6.   

    select * from tb where conditionPary_id <> condition_id 
      

  7.   


    如果有空字段可以这样用isnull这个函数
    declare @tb table (id int,conditionPary_id int,condition_id int)
    insert into @tb select 1,0,1
    insert into @tb select 2,1,1
    insert into @tb select 3,2,3
    insert into @tb select 4,5,5select * from @tb t
    where isnull(conditionPary_id,0)<>isnull(condition_id,0)
      

  8.   

    select * from tb where ltrim(rtrim(conditionPary_id)) <> ltrim(rtrim(condition_id)) 去掉空格
      

  9.   

    select * from tb 
    where conditionPary_id!=condition_id
      

  10.   

    select * from table where conditionPary_id <> condition_id