在ID上添加小数分隔符

时间:2016-05-26 00:42:09

标签: sql database

Screenshot of my Accounts table]

我需要在项目ID(prjID)上添加(decimal - 2个地方)。

到目前为止,这是我凌乱的代码

UPDATE AxProject
   SET prjID = SUBSTRING(prjDescription, 1, CHARINDEX(' ', prjDescription,1) -1)
 WHERE prjID LIKE '% %' AND prjKey = prjProject AND prjKey > 2 AND prjKey <= '208'

1 个答案:

答案 0 :(得分:0)

试试这个

UPDATE AxProject SET prjID = substring(prjID from 0 for char_length(prjID ) -1 ) || '.' || substring(prjID from '..$') ;