How can I assign a name to the SUM column?

前端 未结 3 402
离开以前
离开以前 2020-12-06 22:00

how can I assign a column name to the SUM column ?

i.e.

select OwnerUserId, SUM(PostScore)
INTO Experts
from ...

I get this error:

3条回答
  •  Happy的楠姐
    2020-12-06 22:32

    select OwnerUserId, SUM(PostScore) as mySum
    INTO Experts
    from ...
    

    or

    select OwnerUserId, SUM(PostScore) [mySum]
    INTO Experts
    from ...
    

提交回复
热议问题