第一张表 ShopCart 表CartID int 主键,
GoodsID int,
Quantity int,
UserID int,
TotalPrice float第二张表 BuyInfo 表
BuyID int 主键,
GoodsID int,
Quantity int,
TotalPrice float,
OrderID int要将第一张表的一条记录插入到第二张表中 //主键自增(貌似不用插)本人真的不会,伤脑筋
求教了 QQ:317401317
GoodsID int,
Quantity int,
UserID int,
TotalPrice float第二张表 BuyInfo 表
BuyID int 主键,
GoodsID int,
Quantity int,
TotalPrice float,
OrderID int要将第一张表的一条记录插入到第二张表中 //主键自增(貌似不用插)本人真的不会,伤脑筋
求教了 QQ:317401317
select GoodsID,Quantity,TotalPrice from ShopCart
Quantity ,
TotalPrice ,
OrderID ) select
GoodsID ,
Quantity ,
UserID ,
TotalPrice from ShopCart
insert buyinfo(buyid,GoodsID,Quantity,OrderID,TotalPrice)
select * from ShopCart
set SET IDENTITY_INSERT buyinfo off
(GoodsID ,Quantity,OrderID ,otalPrice )
SELECT GoodsID ,Quantity ,UserID ,TotalPrice ) FROM ShopCart WHERE ..
insert buyinfo(BuyID,GoodsID,Quantity,OrderID,TotalPrice)
select CartID,GoodsID,Quantity,OrderID,TotalPrice
from ShopCart
set SET IDENTITY_INSERT buyinfo off