首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > SQL Server >

请问,关于表内容复制有关问题

2012-01-31 
请教,关于表内容复制问题表table1:newcodeiPriceAveragebjrqyearbjrqmonthbjrqdate2007080215263125002007

请教,关于表内容复制问题
表table1:
    newcode                     iPriceAverage         bjrqyear       bjrqmonth           bjrqdate
20070802152631               2500                           2007               08                         02

表table2:
    newcode                 historyprice             ptime
20070802152631             2500                   2007-08-02

就是将表一的内容复制到表二,其中bjrqyear是年,bjrqmonth是月,bjrqdate是日。
谢谢



[解决办法]
insert table2
select newcode, iPriceAverage, bjrqyear + '- ' + bjrqmonth + '- ' + bjrqdate
from table1
[解决办法]
這個意思?

Insert 表二 Select newcode, iPriceAverage, Cast(bjrqyear As Varchar) + '- ' + Cast(bjrqmonth As Varchar) + '- ' + Cast(bjrqdate As Varchar)

热点排行