some google search with the error sentence gave the correct result here:
MySQL Bugs: #13551: #1054 - Unknown column 'xxxx' in 'on clause'
we need to put paranthesis around from tables and join expressions:
like below:
... FROM (table1, table2)
join ... ON (col1=col2)
incase anyone comes accross the same error.