I have a process that before sending data to the database must check if the data exists in the database or not. And if he found a similarity, I want to show a percentage similarity. I have a query like:
SELECT [NAME]
,[IDENTITY_NUMBER]
,[BIRTHDATE]
,[SEX]
FROM [USER]
WHERE [NAME] = @NAME
OR [IDENTITY_NUMBER] = @IDENTITY_NUMBER
OR [BIRTHDATE] = @BIRTHDATE
OR [SEX] = @SEX
I want to do it, if only the name matches the name I entered and the name that exists in the database, it looks like 25%. if only name and date of birth, then 50%. if everything is similar, then 100%. Do you know how?
source
share