开发者

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

开发者 https://www.devze.com 2023-02-03 03:59 出处:网络
I hv a table like this:- ItemModelRemarks ----------------------------------------- A10022009 B10032006 C05081997

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

精彩评论

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