开发者

SQL replace syntax

I have a sele开发者_JAVA百科ct query that gets a field and displays it with a custom name, ex acctID as ACCOUNT ID. If the data for this field is a varchar but is all numbers with decimals ex 000.887.4456.000000, how do I use replace in that select query to remove the decimals from a field like this?


SELECT REPLACE(acctID, '.', '') AS ACCOUNT_ID FROM TABLE

REPLACE function reference here


REPLACE(acctID, '.','') AS AccountID


SELECT 
    ex.acctID,
    REPLACE(ex.acctID, '.', '')
FROM
    Mytable
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜