SQL Server,如何将两列合并为一列?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/25207771/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-01 02:25:22 来源:igfitidea点击:
SQL Server, how to merge two columns into one column?
提问by user3807363
I have a SQL query
我有一个 SQL 查询
SELECT TABLE_SCHEMA + TABLE_NAME AS ColumnZ
FROM information_schema.tables
I want the result should be table_Schema.table_name
.
我想要的结果应该是table_Schema.table_name
。
help me please!!
请帮帮我!!
回答by Adrian
Try this:
尝试这个:
SELECT TABLE_SCHEMA + '.' + TABLE_NAME AS ColumnZ
FROM information_schema.tables
回答by Dai
SELECT CONCAT(TABLE_SCHEMA, '.', TABLE_NAME) AS ColumnZ FROM information_schema.tables
回答by Sunil Acharya
This code work for you try this....
这段代码适合你试试这个......
SELECT Title,
FirstName,
lastName,
ISNULL(Title,'') + ' ' + ISNULL(FirstName,'') + ' ' + ISNULL(LastName,'') as FullName
FROM Customer