Pick first three characters of a column for Join query in Oracle

This is in Oracle.

I have to write an Inner Join query between first set of query and the second set of query.

Second set of query has a column name pri_psl_cd. To this column i need to see the prefix 3 letters matching criteria to the upper join query for the prefix 3 letters of cte.pri_psl_cd. I wonder is there any way to read first three characters of the column and matching with first 3 characters of the second query for that column.


with cte as
(
select      A.ac_sys_nr,A.ac_nr,A.ac_na,
            trunc(A.ac_opn_dt) open_date,
            B.pri_psl_cd,B.customer_seg_cd,
            B.psl_job_cgy_elg_cd 
from        A55601.tacprof A
Inner Join  a55601.tacphas B
on          A.ac_sys_nr = B.ac_sys_nr
Inner Join  a55601.tactosr C
on          A.ac_sys_nr = C.ac_sys_nr
where       A.ac_ad_cny_cd = 'CA'
and         A.dat_cx_tm_prd_nr = 0
and         trunc(A.ac_opn_dt) >= '15-FEB-2015'
and         B.customer_seg_cd <> 'EN'
and         B.cny_cd = 'CA'
and         B.dat_cx_tm_prd_nr = 0
and         B.psl_job_cgy_elg_cd = '2'
and         C.svc_pvr_pyr_nr in ('S13CAEXNP','S13CAEXNA')
)
select          cte.ac_sys_nr,cte.ac_nr,cte.ac_na,cte.open_date,cte.pri_psl_cd,
                cte.customer_seg_cd,cte.psl_job_cgy_elg_cd
from            cte



/

select * from a55601.tpcplsr 
where  dat_cx_tm_prd_nr = 0
and cny_cd = 'CA'
-- and pri_psl_cd = Pick Prefix of first 3 Letters.

Open in new window

chokkaStudentAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

sdstuberCommented:
for ORACLE

SUBSTR(cte.pri_psl_cd,1,3)
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
chokkaStudentAuthor Commented:
Thanks
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Oracle Database

From novice to tech pro — start learning today.