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
精彩评论