如何将数字量从欧洲风格转换为美式风格

时间:2018-01-12 16:28:12

标签: sql tsql sql-server-2008-r2

我有一个sql查询,它从表中读取while (running) { List<CloudwatchLogsLogEvent> logEvents = new ArrayList<>(); eventQueue.drainTo(logEvents); printWithTimestamp( "Draining events from eventLoop. No. of events received = " + logEvents.size()); if(logEvents.size() > 0) { printWithTimestamp( "Translating " + logEvents.size() + " log events to CloudWatch Logs..."); logEvents.stream().forEach(logEvent -> translateLogEventToCloudWatchLog(logEvent)); printWithTimestamp( "Translating " + logEvents.size() + " log events to CloudWatch Logs... DONE"); } boolean timeToFlush = isTimeToFlush(); printWithTimestamp( "isTimeToFlush() = " + timeToFlush); printWithTimestamp( "eventBatch.size() = " + eventBatch.size()); if (!eventBatch.isEmpty() && timeToFlush) { printWithTimestamp( "Event Batch is NOT empty and it's time to flush"); flush(); } try { printWithTimestamp( "going to sleep..."); Thread.sleep(100); printWithTimestamp( "done sleeping..."); } catch (InterruptedException e) { printWithTimestamp( "Exception while flushing and sleeping..."); running = false; } } (欧盟100万欧元)等值。我需要查询将这些解释为1.000.000,000(美国100万)。我该怎么做呢?

1 个答案:

答案 0 :(得分:0)

你可以这样做

 SELECT CAST(REPLACE(REPLACE('523,916','.',''), ',','.') AS NUMERIC(20,2));