Encrypting a column to compare with an encrypted column on select query
Can I receive assistance, please?
I have the below query where I'm doing a LEFT JOIN between 2 tables. For the ON columns, one value is encrypted and the other isn't. Is there a way to use "hash("sha256", zCIFRecord.CIFPan);" to encrypt zCIFRecord.CIFPan so I can compare?
zCIFRecord.CIFPan = CIFExtraInfo.PanHash
select CIFExtraInfo.Email,zCIFRecord.RecordId,zCIFRecord.CIFPan,zCIFRecord.CIFAcctNum1,
CONCAT(zCIFRecord.CIFFName, ' ', zCIFRecord.CIFLName) AS name,zCIFRecord.CIFCIFPhone,zCIFRecord.CIFExpDate,
zCIFRecord.CIFUpdateActivity,zCIFRecord.CIFUpdateDate,zCIFRecord.CIFCardStat,CIFUserId,CIFDateTime,
row_number() over(partition by zCIFRecord.CIFPan order by zCIFRecord.CIFDateTime desc) as row_num from zCIFRecord LEFT JOIN CIFExtraInfo ON zCIFRecord.CIFPan = CIFExtraInfo.PanHash)
Any assistance provide will be appreciated.