lozina
Lifer
I would like a universal sql statement (universal meaning it will work on all databases) to pull a full name from a table where the first name, last name and middle initial are all separated. The tough part is incorporating the middle initial with proper spacing...
for example:
first_name = john
last_name = smith
middle_initial = x
I could do: select first_name || ' ' || middle_initial || ' ' || last_name which will work great if there is a middle initial, but if that field is null then it prints the name with two spaces between the first name and last name. Is there a way ?
for example:
first_name = john
last_name = smith
middle_initial = x
I could do: select first_name || ' ' || middle_initial || ' ' || last_name which will work great if there is a middle initial, but if that field is null then it prints the name with two spaces between the first name and last name. Is there a way ?