Avatar of pardeshirahul
 asked on

how to remove the space in the data to get the value

I have a query

 SELECT p1.person_id
           FROM per_all_people_f p1
          WHERE UPPER (trim(p1.last_name) || ', ' || trim(p1.first_name)) =
                   UPPER ('LEJOLIVET               , HUBERT')
                AND p1.business_group_id = 1747
                AND p1.current_employee_flag = 'Y'
                AND p1.effective_start_date =
                       (SELECT MAX (pp.effective_start_date)
                          FROM per_all_people_f pp
                         WHERE pp.person_id = p1.person_id
                               AND pp.business_group_id =

the data which i am getting is 'LEJOLIVET               , HUBERT'
now when i am comparing it with UPPER (trim(p1.last_name) || ', ' || trim(p1.first_name)) =

i am not getting the value
individual last_name 'LEJOLIVET'  and first_name 'HUBERT'
is in the table
Oracle Database

Avatar of undefined
Last Comment
slightwv (䄆 Netminder)

8/22/2022 - Mon
slightwv (䄆 Netminder)

I don't think I'm understanding the problem.

Are you saying that UPPER (trim(p1.last_name) || ', ' || trim(p1.first_name))  is returning values with spaces in it?

If not, try:

WHERE UPPER (trim(p1.last_name) || ', ' || trim(p1.first_name)) =
                   UPPER ('LEJOLIVET,HUBERT')

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
slightwv (䄆 Netminder)

Better: why concat them?

WHERE UPPER (trim(p1.last_name)) = 'LEJOLIVET' and upper(trim(p1.first_name)) = ('HUBERT')
Your help has saved me hundreds of hours of internet surfing.