关于Backup数据库的问题,在线等!
CREATE TABLE ado_Transaction_File_Backup(Item_Number nvarchar(50),Warehouse_id nvarchar(4),
Quantity numeric(18,4),Measure_Code nvarchar(2),Reject_Flag int)
Select Item_Number,Warehouse_id,Sum(Quantity),Measure_Code,Reject_Flag,Trans_Date Into ado_Transaction_File_Backup
From ado_Transaction_File Group By Item_Number,Warehouse_id,Reject_Flag
哪位大侠看下,不知道问题出在什么地方,是不是有专业上的问题
就是想对表进行筛选后插入记录
------解决方案--------------------Group By 语句的 select 部分的字段列表中只能出现 group by 后面列出的字段名称,如果要用其他字段名称,要包含才 aggregate function 的参数列表中。
Select Item_Number,Warehouse_id,Sum(Quantity),Measure_Code,Reject_Flag,Trans_Date Into ado_Transaction_File_Backup
From ado_Transaction_File Group By Item_Number,Warehouse_id,Reject_Flag
去掉 Measure_Code, Trans_Date
Select Item_Number,Warehouse_id,Sum(Quantity),Reject_Flag
Into ado_Transaction_File_Backup
From ado_Transaction_File
Group By Item_Number,Warehouse_id,Reject_Flag