tab.col1、tab.col2、tab.col3、tab.col4の値をResult.INTRと比較することによるRSC
タブテーブルには数千行あります
col1から4のいずれかがNULLの場合、1を返します
Col1 will hold values pertaining to RID = 10
Col2 will hold values pertaining to RID = 20
Col3 will hold values pertaining to RID = 30
Col4 will hold values pertaining to RID = 40
例:
if tab.col1 is 3 then 4
if tab.col2 is 'R' then 3
if tab.col3 is 1900 then it query should give 4
if 1945 then 3
if 1937 then 3 (lower bound is less than and upper bound is greater than equal to)
if tab.col4 is 6 then 5
and so on.....
Result table
RID INTR RSC
----- ----- -----
10 1 0
10 2 1
10 3 4
10 4 2
20 I 4
20 R 3
20 U 1
30 1900 5
30 1900-1937 4
30 1937-1967 3
30 1967 3
40 3-4 2
40 1-3 1
40 4 5