coalesce (per.KNOWN_AS,per.FIRST_FORNAME) FNAME,

Hi guys,

coalesce (per.KNOWN_AS,per.FIRST_FORNAME) FNAME,

Open in new window


I was expecting the above to:

- Use the known_as name if there is a known as name
- Use the FIRST_FORNAME if there is no KNOWN_AS name

However.

The known_as name is populated if its there, although the FORENAME isnt being populated if there is no KNOWNAS name, despite FORENAME being avaiable.

Why is this?
Richiep86Asked:
Who is Participating?
 
slightwv (䄆 Netminder) Commented:
If the field does contain spaces, just trim it:
coalesce (trim(per.KNOWN_AS),per.FIRST_FORNAME) FNAME,
0
 
johnsoneSenior Oracle DBACommented:
Can you provide some sample data?

COALESCE works with NULLs, if the value of KNOWN_AS is not NULL (if it contains spaces), then it will be used.
0
 
Richiep86Author Commented:
It had white spaces in the surname.

Thanks alot!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.