我设计了一个新的应用程序。 我使用sQL服务器。所以我有一个问题。 我想要table tbStock caculate,在列tbStock.quality = tbImport.quality - tbExport.quality 但他们必须遵循字段批处理。 这是我的代码。不工作更新以下批次的股票
create proc [dbo].[sp_XuatLayBatch]
@Ma as nchar(14)
as
select sum(tbImport .SoLuong)as SLN,sum(tbExport .SoLuong)as SLX,tbImport .Batch from tbImport, tbExport
where tbImport .Ma = @Ma and (tbExport.Ma=tbImport .Ma or tbExport.Ma is null)
group by tbImport .Batch
这是我的照片。 http://www.mediafire.com/view/l5fyiaa8flolgda/Batch_tong_2.JPG
这只是SP选择一些款项,究竟你需要达到什么目的? – gofr1
你想做什么? Sp和Formula之间关于质量的联系是什么? – KuldipMCA
感谢您的帮助。 –