100分求2道面试题目的答案,灰常感谢
1个回答
展开全部
四个SQL语句如下:
select a.t_ysear, sum(b.ta_num) as '销售金额'
from t_sales a, t_sales b
where b.t_ysear<=a.t_ysear
group by a.t_ysear
select max(t.a, t.b)
from t
union
select max(t.b, t.c)
from t
select a.id, count(*) CCC
from t a, t b
where a.id=b.id
and ccc > 1
group by a.id
假设表结构为t_rec{sn, acc_id, balance, dt}
语句为:
select acc_id, date(dt) dd, min(balance)
from t_rec
group by dd, acc_id
select a.t_ysear, sum(b.ta_num) as '销售金额'
from t_sales a, t_sales b
where b.t_ysear<=a.t_ysear
group by a.t_ysear
select max(t.a, t.b)
from t
union
select max(t.b, t.c)
from t
select a.id, count(*) CCC
from t a, t b
where a.id=b.id
and ccc > 1
group by a.id
假设表结构为t_rec{sn, acc_id, balance, dt}
语句为:
select acc_id, date(dt) dd, min(balance)
from t_rec
group by dd, acc_id
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询