表结构:
昨天遇到一个笔试题,求一个聚合函数小于等于1000的值,并将编号同时输出.
sql server:
select nid,SUM(amount) amountSum from orders_jimmy group by nid having SUM(amount) <= 1000; go
oracle:
select nid,SUM(amount) from orders_jimmy group by nid having SUM(amount) <= 1000;
完成.
表结构:
昨天遇到一个笔试题,求一个聚合函数小于等于1000的值,并将编号同时输出.
sql server:
select nid,SUM(amount) amountSum from orders_jimmy group by nid having SUM(amount) <= 1000; go
oracle:
select nid,SUM(amount) from orders_jimmy group by nid having SUM(amount) <= 1000;
完成.