update comp_journal a, view_journal_table b set a.referrence = b.referenceNo where a.companyID = b.companyID and a.journalID = b.journalID and a.companyID = 2 and a.journalID ="AR20200800000039" and a.referrence is null