Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

sql join on two tables where column like another column

782530Apr 19 2011 — edited Apr 19 2011
hi all,


been trying to get the results from a join between two tables where one column is like another one.

table1 (nameA) examples: black2, green1

table2 (nameB) example: black2.location.uk.com, green1.location.uk.com

so for example I want to match all those in table1 with black2 to the column in table2 that begins with black2 and so on if you see what im trying to get at!

my sql so far:
select * from  schema.table1 a
join schema.table2 b 
on a.nameA like concat('%', b.nameB, '%'); 
but it errors:

ORA-00909: invalid number of arguments
00909. 00000 - "invalid number of arguments"

Any help or advice would be greatly appreciated, thankyou!
This post has been answered by BluShadow on Apr 19 2011
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 17 2011
Added on Apr 19 2011
2 comments
745 views