Hi,
I have a table A (=30 Mill Record) with a String,
that I want to compare with a table B (200 Records).
I want to find the longest String from B that matches with the
String from A.
My Solution:
Select Case When Substr(A.StringA,1,3) = (Select B.Substr from B
Where Substr(A.StringA,1,3)=B.Substr
)
When Substr(A.StringA,1,2) = (Select B.Substr from B
Where Substr(A.StringA,1,2)=B.Substr
)
When Substr(A.StringA,1,1) = (Select B.Substr from B
Where Substr(A.StringA,1,1)=B.Substr
)
Else '0'
END
From A
Is there a solution which is more performant, because this takes very, very long :-(
I use oracle, with no Index on this tables.
so long
farhy
I have a table A (=30 Mill Record) with a String,
that I want to compare with a table B (200 Records).
I want to find the longest String from B that matches with the
String from A.
My Solution:
Select Case When Substr(A.StringA,1,3) = (Select B.Substr from B
Where Substr(A.StringA,1,3)=B.Substr
)
When Substr(A.StringA,1,2) = (Select B.Substr from B
Where Substr(A.StringA,1,2)=B.Substr
)
When Substr(A.StringA,1,1) = (Select B.Substr from B
Where Substr(A.StringA,1,1)=B.Substr
)
Else '0'
END
From A
Is there a solution which is more performant, because this takes very, very long :-(
I use oracle, with no Index on this tables.
so long
farhy