开发者

sql server select column

What is the difference between

 1).
 SELECT
      开发者_如何学Ce.name 'name',
      e.age  'age'
 FROM
 Employee e

 2).
 SELECT
      e.name name,
      e.age  age
 FROM
 Employee e


In the first you are qualifying the column aliases as strings, in the second you are not.

Functionally, they are the same.

They would product the same result as:

SELECT
   e.name,
   e.age
FROM
Employee e


e.g. if you like to use column names with space, special characters or reserved SQL words you need qualifying. Otherwise the quotes are optional.

SELECT
  e.name 'first name'
  ...
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜