case语句报错帮忙看看
case when TableName.Colunme1  in (select aaa from  Table1 )  then '1' when TableName.Colunme1 not in (select aaa from  Table1 ) then '0' end

解决方案 »

  1.   

    试试看这个:
    case when EXISTS (select ‘0’ from  Table1 WHERE aaa = TableName.Colunme1)  then '1' ELSE when NOT EXISTS (select aaa from  Table1 WHERE aaa = TableName.Colunme1) then '0' end
      

  2.   

    select count(*) into i from Table1 where aaa=TableName.Colunme1
      

  3.   

    decode((select count(*) from table1 where aaa=TableName.Colunme1),0,'0','1')
      

  4.   

    要不用Decode也可以
    select decode((select count(*)
                    into i
                    from Table1
                   where aaa = TableName.Colunme1),
                  0,
                  0,
                  1)
      from dual