I am having problem with sql. I want to join two tables, employee and class instructor. Condition is that employee is having unid column like \'u0871457\' where as class i
Oracle uses 1 as the base of its indexes, so substr('aaa',1,3) is equivalent to 'aaa'. You need to use 2 as the second parameter of substr in order to accomplish what you're attempting.
Beyond that, you'd probably be better off only changing one side, if you can. If the prefix characters are consistent, you could do this:
SELECT e.name, i.name
FROM employee e INNER JOIN instructor i ON REPLACE (e.id, 'u', '0') = i.id
This would potentially allow the database to use an index on instructor, which would not be possible with your solution.