在新列中更新sql查询

时间:2021-01-02 07:43:15

I have a column in which i have 'goswara no. 21/1980' i need only 21 and year from date column like this col gr=21/year(date) through sql2005 query

我有一个专栏,我有'goswara没有。 21/1980'通过sql2005查询我只需要21日和年日期栏这样的col gr = 21 /年(日期)

1 个解决方案

#1


0  

http://sqlfiddle.com/#!6/bf991/6

something like this? select right(columnname,4) as year , SUBSTRING ( columnname ,len(columnname) - 6 ,2 ) as result from test

这样的事情?选择正确(列名,4)作为年份,SUBSTRING(列名,len(列名) - 6,2)作为测试结果

#1


0  

http://sqlfiddle.com/#!6/bf991/6

something like this? select right(columnname,4) as year , SUBSTRING ( columnname ,len(columnname) - 6 ,2 ) as result from test

这样的事情?选择正确(列名,4)作为年份,SUBSTRING(列名,len(列名) - 6,2)作为测试结果