如何使用sql server将值插入到新表中

时间:2014-02-24 21:29:38

标签: sql sql-server insert

我有3张桌子:

vehicle, line, brands.

我需要将车辆的值插入新表vehicleNew,问题是表vehicle包含这些列vehicleId, lineName, brandsName

新表vehicleNewvehicleId, lineCode, brandsCode如何插入值?

1 个答案:

答案 0 :(得分:1)

insert into vehicleNew(vehicleId, lineCode, brandsCode)
    select vehicleId, lineName, brandsName from vehicle