回应培训套件考试70-461

时间:2014-11-11 12:00:42

标签: sql sql-server

我正在攻读考试70-461。这本书的问题是:

1. Suppose you want to rename the result attribute phone to phone number. Here’s an attempt to alias the attribute with the identifier phone number without delimiters.

SELECT S.shipperid, companyname, phone AS phone number FROM Sales.Shippers AS S;

我的回答是:

SELECT S.shipperid, companyname, phone AS PhoneNumber FROM Sales.Shippers AS S;

答案很简单?我在哪里可以回复Training Kit 70-461?

1 个答案:

答案 0 :(得分:1)

你需要在Square Brackets中保留别名,以显示带空格的电话号码。

SELECT S.shipperid, companyname, phone AS [phone number] FROM Sales.Shippers AS S

OR

SELECT S.shipperid, companyname, phone AS 'phone number' FROM Sales.Shippers AS S