Sample Header Ad - 728x90

how to select column3 from rec1 value which is matched to column1 val in rec2

-3 votes
1 answer
87 views
I am having following scenario : col1 col2 col3 10 2 13 13 4 14 14 5 15 15 6 16 From the above given table col3 value(13) in row1 is seen in col1 value(13) in row2 and this chain continues... Here my input column is col1 and i have to get col3 value where the chain ends up. Condition is col3 value should match with next row col1 value. example input-----> col1 = 10, output----->col3 = 16. Another table : col1 col2 col3 151 6 162 162 4 163 163 67 164 102 2 101 101 4 107 107 5 103 v1 2 v2 v2 4 v3 v3 5 v5 Here is my input -->(151,v1,102) , output---->(164,v5,103) Unfortunately, I am not supposed to use stored procedures. I am struggling on this for couple of hours...please help me.
Asked by vinay (1 rep)
Jun 24, 2014, 07:40 AM
Last activity: Jul 14, 2025, 01:40 PM