Skip to content
Advertisement

Oracle SQL – Outer join based on concat

I need to cross join two tables but the joining conditions are:

I want to outer join the column To_Number(Concat(Location, Channel_Id)) with ItemLoc.Loc where to put the (+) sign

Advertisement

Answer

First, use explicit join syntax – the old (+) is hard to read and easy to get wrong. Second, use the || operator instead of the CONCAT function – again, easier to read. So we end up with

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement