In SQL, is it possoble to define my own comparison function# Database - 数据库
D*h
1 楼
For example, for tables A, B with Name, ID
I want to
select A.Name
from A, B
where A.Name = B.Name
but here the = is not strict equal. They are seen to be equal if these two
strings A.Name and B.Name are different with at most 1 character. For
example, 'John' and 'Johnn' are equal.
Is there any way to define a function to deal with this? Can I define a
function else where to define this equal, than then use it after "where"?
Thanks
I want to
select A.Name
from A, B
where A.Name = B.Name
but here the = is not strict equal. They are seen to be equal if these two
strings A.Name and B.Name are different with at most 1 character. For
example, 'John' and 'Johnn' are equal.
Is there any way to define a function to deal with this? Can I define a
function else where to define this equal, than then use it after "where"?
Thanks