高悬赏!Access查询SQL语句问题,第2、4、6题,第六题要求用一个查询完成,急求!!!!
2个回答
展开全部
2
select a.交易号,b.数量,round(avg(a.销售数量*a.售价),2) as 平均金额
from 销售账目 as a,
(select t.交易号,count(*) as 数量 from
(select 交易号,书号 from 销售账目 group by 交易号,书号) as t
group by t.交易号) as b
where a.交易号=b.交易号
group by a.交易号,b.数量 having min(a.销售数量*a.售价)>=1000
order by b.数量 desc
4
select a.书名,sum(b.销售数量) as 销售总数,sum(b.销售数量*b.售价) as 销售总价
from 图书目录 as a,销售账目 as b where a.书号=b.书号 and a.书名 in ('计算机文化基础','计算机文化基础习题与实验')
group by a.书名
6
update 图书目录 set 是否缺货=switch(是否缺货='缺货','不缺货',true,'缺货')
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询