Thanks,
That worked. Also I tried the same without inner query, just by refering to routeprefix table as two tables with different aliases. Even that worked, the query I used is ..
select r1.route as cfrom, r2.route as cto
from activity_log a, routeprefix r1, routeprefix r2
where...