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!

to_char not working , || is working with join query

NehaRKMar 22 2013 — edited Mar 22 2013
Hi,

I have two tables : oa_membership_dtl(in this created_by field is varchar2(200 byte) ,oa_partner_usr_dtl(in this table partner_userid is number(8,0)
i need to do join on above fields.
I am using following two queries:


select * from oa_membership_dtl membership
join oa_partner_usr_dtl partner_user
on to_char(partner_user.partner_userid,'9999')=membership.created_by

select * from oa_membership_dtl membership
join oa_partner_usr_dtl partner_user
on rtrim(ltrim(partner_user.partner_userid||' '))=rtrim(ltrim(membership.created_by))

by using first data is not fetched but 2nd is working fine , i am getting the matched records using 2nd query.

question is why its is so? whats the diff between to_char and || symbol???
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 19 2013
Added on Mar 22 2013
1 comment
1,210 views