Below is the code I have as part of a sqlalchemy query. Most of the time fist name is null. But Here in the case of below statement, always returns last name with a comma. Eg: lastName
,
How to add comma only if there's first name?
(func.isnull(
prv.last_name,
'') +
', ' +
func.isnull(
prv.first_name,
'')).label('MyName')