select wname,cid,checkdate,detail1,( case when detail2=detail1 then '' else detail2 end) as detail2 from table