开发者

how to copy from one column to another but with different format

I hv a table like this:-

Item            Model           Remarks 
-----------------------------------------
A               10022009
B               10032006
C               05081997

I need to copy the info from "Model" to "Remarks" with the following format:-

Item            Mode开发者_如何学Pythonl          Remarks 
-----------------------------------------
A               10022009       20090210
B               10032006       20060310
C               05081997       19970805

Thanks


update the_table set remarks = 
   substr(model, 5, 4) || substr(model, 3, 2) || substr (model, 1, 2)

You could also use date parsing / formatting functions instead of string operations.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜