I am using coalesce(firstname,lastname), to get the result if first name is 'NULL' it will give me lastname or either way. I am having data like instead of NULL, blank null ( i mean something like '' ) for which coalesce is not working, is there any workaround or other function available in postgresql, please do let me know.