I have 2 tables as follows:
tbl_emp
emp_code name
1 A
2 B
3 C
4 D
tbl_from_to
col_from col_to
4 2
1 2
2 3
3 4
what I wanted is an output like this:
res_from res_to
D B
A B
B C
C D
I tried:
select emp.name, emp.name
from tbl_emp emp
join tbl_from_to
on emp.emp_code = ft.col_from
or --also tried and
emp.emp_code = ft.col_to
and the result is like this
res_from res_to
D D
A A
B B
C C
