Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想知道如何将此查询从 Redshift 转换为 Azure SQL DW ?
to_char(date_add('ms', vw.datetb, vw.date col), 'MM/DD/YY HH:MI:SS AM')
Azure SQL 数据仓库没有该FORMAT功能,因此我认为您必须拼凑几个调用才能CONVERT使用其格式开关,如下所示:
FORMAT
CONVERT
SELECT *, CONVERT( CHAR(8), DATEADD( millisecond, vw.datetb, vw.dateCol ), 1 ) + ' ' + RIGHT( CONVERT( CHAR(20), DATEADD( millisecond, vw.datetb, vw.dateCol ), 22 ), 11 ) FROM yourTable vw
我的结果: