我有一个SQL查询
SELECT TABLE_SCHEMA + TABLE_NAME AS ColumnZ
FROM information_schema.tables
我希望结果应为table_Schema.table_name
。
答案 0 :(得分:13)
试试这个:
SELECT TABLE_SCHEMA + '.' + TABLE_NAME AS ColumnZ
FROM information_schema.tables
答案 1 :(得分:2)
SELECT CONCAT(TABLE_SCHEMA, '.', TABLE_NAME) AS ColumnZ FROM information_schema.tables
答案 2 :(得分:2)
这段代码适合你试试....
SELECT Title,
FirstName,
lastName,
ISNULL(Title,'') + ' ' + ISNULL(FirstName,'') + ' ' + ISNULL(LastName,'') as FullName
FROM Customer
答案 3 :(得分:0)
从SQL Server 2017开始,有CONCAT_WS
运算符与分隔符连接。
SELECT CONCAT_WS('.', TABLE_SCHEMA ,TABLE_NAME) AS ColumnZ
FROM information_schema.tables