title: Join condition in Oracle query
body: <p>I have following query which update the coulmn "tmp_activation_date" of rec_tmprecord table with max of actdate according to the conditions mentioned in query.</p>
  
  <pre><code>MERGE INTO rec_tmprecord
     USING (SELECT   rec.ID, MAX (act.actdate) AS tmpactivation_date
                FROM rec_tmprecord rec INNER JOIN tmp_asset asset
                     ON asset.serial = rec.serialtemp 
                     and upper (replace (asset.prodname, 'Ajink ')) = upper (replace (rec.prodnametemp, 'Ajink '))
                     and NVL(asset.release,'NF') = NVL(rec.tmprelease ,'NF')
                     and rec.serialtemp != 'aaa-aaaaaaaa'                   
                     LEFT JOIN tmp_acti_hist act
                     ON asset.tmp_id = act.tmp_row_id
               WHERE rec.cust_id = 234567
            GROUP BY rec.cust_id,asset.serial,rec.ID) new_values
     ON (rec_tmprecord.ID = new_values.ID)
     WHEN MATCHED THEN
        UPDATE
           SET tmp_activation_date = new_values.tmpactivation_date
        ;
  </code></pre>
  
  <p>But,When i analyzed the data of table "rec_tmprecord",i found that there are some null or blank values present in the "prodnametemp" column of "rec_tmprecord" table.But,column "prodname" of the table "tmp_asset" does not contain any null or blank values. 
  So,my join condition will fail at "upper (replace (asset.prodname, 'Ajink ')) = upper (replace (rec.prodnametemp, 'Ajink '))" condition and as a result  "tmp_activation_date" of rec_tmprecord table will be updated with null value or blank value.</p>
  
  <p>what my requirement is if "prodnametemp" is having null value and "prodname" contains some value  then also "tmpactivation_date" will get calculated on the basis of other conditions mentioned in the query.
  Anyhelp on this would be greatly appreciated. </p>