以上好象没有DISTINCT 啊?

解决方案 »

  1.   

    TRY:
       SELECT  
             cont_bg.contno,   
             cont_bg.userid,   
             cont_bg.dpid,   
             cont_bg.modidate,   
             cont_bg.valid,   
             cont_bg.itemno,   
             cont_bg.number,   
             cont_bg.colnote,   
             cont_bg.old_value,   
             cont_bg.new_value  
        FROM cont_bg   
     where contno in ( select icontno from incont where preno='03FMEYS0010' union select ocontno from outcont where preno='03FMEYS0010' ) 
      union (   SELECT  
             cont_bg.contno,   
             cont_bg.userid,   
             cont_bg.dpid,   
             cont_bg.modidate,   
             cont_bg.valid,   
             cont_bg.itemno,   
             cont_bg.number,   
             cont_bg.colnote,   
             cont_bg.old_value,   
             cont_bg.new_value  
        FROM cont_bg   
     where contno='03FMEYS0010')
      

  2.   

    SELECT  
             cont_bg.contno,   
             cont_bg.userid,   
             cont_bg.dpid,   
             cont_bg.modidate,   
             cont_bg.valid,   
             cont_bg.itemno,   
             cont_bg.number,   
             cont_bg.colnote,   
             cont_bg.old_value,   
             cont_bg.new_value  
        FROM cont_bg   
     where contno in ( select icontno from incont where preno='03FMEYS0010' union select ocontno from outcont where preno='03FMEYS0010' ) or contno='03FMEYS0010'
      

  3.   

    try:(SELECT  
             cont_bg.contno,   
             cont_bg.userid,   
             cont_bg.dpid,   
             cont_bg.modidate,   
             cont_bg.valid,   
             cont_bg.itemno,   
             cont_bg.number,   
             cont_bg.colnote,   
             cont_bg.old_value,   
             cont_bg.new_value  
        FROM cont_bg   
     where contno in ( select icontno from incont where preno='03FMEYS0010' union all select ocontno from outcont where preno='03FMEYS0010' ) )
      union all (   SELECT  
             cont_bg.contno,   
             cont_bg.userid,   
             cont_bg.dpid,   
             cont_bg.modidate,   
             cont_bg.valid,   
             cont_bg.itemno,   
             cont_bg.number,   
             cont_bg.colnote,   
             cont_bg.old_value,   
             cont_bg.new_value  
        FROM cont_bg   
     where contno='03FMEYS0010')