So say I have something like this
SELECT CONCAT(fname, " " IFNULL(mname, ""), lname) FROM name
how would I add a space to that statement if mname is not null? Nothing i’ve tried has worked and I’m kind of lost.
Obviously I can do something like
SELECT CONCAT(fname, " " IFNULL(mname, ""), " " lname) FROM name
but then that gives me two spaces instead of 1.
Use another
CONCATin the middle name: