D***h 发帖数: 183 | 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****a 发帖数: 36252 | 2 you can create a function that returns a table of results. but you cannot
overload an operator like "=", nor existing function
two
"where"?
【在 D***h 的大作中提到】 : 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"?
| B*****g 发帖数: 34098 | 3 if oracle 10g2+, try UTL_MATCH.EDIT_DISTANCE
【在 D***h 的大作中提到】 : 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"?
|
|