本文介绍了如何在数据库查询中连接名字和姓氏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在mssql中调整以下查询,以获取FirstName和Lastname列以在表中自动填充Fullname列。我寻求你的帮助。在此先感谢



使用[EXEXORESULTS]

GO



SELECT [竞争对手]

,[FirstName]

,[LastName]

,[DOB]

,[机构]

,[CompetitiveEventName]

,[ParishName]

,[年]

,[FullName]

来自[dbo]。[竞争对手]

GO





示例 - - firstname = John Lastname = Brown Fullname = John Brown(有空格)



我尝试过:



使用数据库查询concat first和lastname

I would like to adjust the below query in mssql to get FirstName and Lastname columns to populate Fullname column automatically in the table. I seek your assistance. Thanks in advance

USE [EXPRORESULTS]
GO

SELECT [CompetitorID]
,[FirstName]
,[LastName]
,[DOB]
,[Institution]
,[CompetitiveEventName]
,[ParishName]
,[Year]
,[FullName]
FROM [dbo].[Competitors]
GO


example --- firstname = John Lastname =Brown Fullname= John Brown (with space)

What I have tried:

concat first and lastname using database query

推荐答案


这篇关于如何在数据库查询中连接名字和姓氏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-20 03:04