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


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?
Who is Participating?
slightwv (䄆 Netminder) Commented:
If the field does contain spaces, just trim it:
coalesce (trim(per.KNOWN_AS),per.FIRST_FORNAME) FNAME,
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.
Richiep86Author Commented:
It had white spaces in the surname.

Thanks alot!
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.