I have problem with SQL join.
I have two tables. table1: name, sth. table2:name,sth.
What I would like to do is to find rows in table2, whose name contains table1.name. e.g such rows should be selected:
table1.name = aa. table2.name = aab
inner join table2 on table2.name like '%'+table1.name+'%'
: Error while compiling statement: FAILED: SemanticException [Error 10017]: Line 2:3 Both left and right aliases encountered in JOIN ''%''
You can try this
select * from table1 t1 where exists (select 1 from table2 t2 where t2.name like '%'+t1.name+'%')