如何使用select语句更改我语言中的日期,如果使用:
if day= sunday then set day = minggu
答案 0 :(得分:0)
您在寻找更新声明吗?因为select语句中有SET。如果是这样,那怎么样?
var body = { "query1": 0.443 };
console.log( body.query1 );
答案 1 :(得分:0)
您需要进行某种转换。看看下面的例子:
WITH Src AS
(
SELECT * FROM (VALUES
(GETDATE()),
(DATEADD(DAY, 1, GETDATE())),
(DATEADD(DAY, 2, GETDATE())),
(DATEADD(DAY, 3, GETDATE())),
(DATEADD(DAY, 4, GETDATE())),
(DATEADD(DAY, 5, GETDATE())),
(DATEADD(DAY, 6, GETDATE()))
) T(Dates)
)
SELECT
FORMAT(Dates, 'ddd', 'id-ID') LocalizedFormat,
SUBSTRING('MingguSen Sel Rabu Kamis Jumat Sabtu ', 6*(DATEPART(WEEKDAY,Dates)-1)+1, 6) LocalizedExpression
FROM Src
结果是:
LocalizedFormat LocalizedExpression
--------------- -------------------
Kamis Kamis
Jumat Jumat
Sabtu Sabtu
Minggu Minggu
Sen Sen
Sel Sel
Rabu Rabu