0
You can use a query to get the same:
您可以使用查詢獲得相同的結果:
SELECT CONCAT(FirstName , ' ' , MiddleName , ' ' , Lastname) AS Name FROM TableName;
Note: This query return if all columns have some value if anyone is null or empty then it will return null for all, means Name will return "NULL"
注意:這個查詢返回如果所有列都有某個值如果有人是null或empty那么它將返回null,這意味着Name將返回" null "
To avoid above we can use the IsNull keyword to get the same.
為了避免上述情況,我們可以使用IsNull關鍵字來獲得相同的結果。
SELECT Concat(Ifnull(FirstName,' ') ,' ', Ifnull(MiddleName,' '),' ', Ifnull(Lastname,' ')) FROM TableName;
If anyone containing null value the ' ' (space) will add with next value.
如果任何人包含空值,“”(空格)將添加下一個值。