5

我有这个查询:

Select
Trunc(Red.Fulfilled_Dtime),
P.Email,
(Red.Points_Deducted *.003)*(1/1.02) As Redeem_Amt,
Red.Player_Id,
Red.Prize_Id, 
Red.Points_Deducted
From Redemption_Log Red
Inner Join Player P On Red.Player_Id=P.Player_Id
Where Red.Prize_Id In (8907,8906,8905,8904,8903,8902,8901)

我想在我的结果中添加一个名为“Currency”的列,其中我的结果中的每一行都有输出“USD”。这可能吗?

4

1 回答 1

11

您可以virtual columnSELECT声明中添加,

SELECT  Trunc(Red.Fulfilled_Dtime),
        P.Email,
        (Red.Points_Deducted *.003)*(1/1.02) As Redeem_Amt,
        Red.Player_Id,
        Red.Prize_Id, 
        Red.Points_Deducted,
        'USD' AS "Currency"                            -- <<== virtual column
FROM    Redemption_Log Red
        Inner Join Player P 
            On Red.Player_Id=P.Player_Id
WHERE  Red.Prize_Id In (8907,8906,8905,8904,8903,8902,8901)
于 2012-09-27T00:43:13.360 回答