Suppl, fields: (Code_name, Code_name_arch, Tasknum, Pki_num, Group_eng, Name, Descr, Cost, Quan, shop)
Maker, fields : (Code_maker, Code_maker_arch, Code_name, provider)
Arrival, fields: (Code_arr, Code_maker, quan_arr)
Accounts, fields: (Code_acc, Code_maker, num_acc, quan_acc)
我的查询是
select Name, Descr, Group_eng,
Sum(quan_arr),
Sum(quan_acc)
from [db_pki].[dbo].[Suppl] as deliveries
LEFT JOIN [db_pki].[dbo].[Maker] ON (deliveries.[Code_name] = [db_pki].[dbo].[Maker].[Code_name])
LEFT JOIN [db_pki].[dbo].[Arrival] ON ([db_pki].[dbo].[Maker].[Code_maker] = [db_pki].[dbo].[Arrival].[Code_maker])
LEFT JOIN [db_pki].[dbo].[Счета] ON ([db_pki].[dbo].[Maker].[Code_maker] = [db_pki].[dbo].[Accounts].[Code_maker])
where Group_eng = '501'
group by Name, Descr, Group_eng
order by Name
Sum(quan_arr)和Sum(quan_acc)无法正常工作。我怎么能解决这个问题?