问题描述
解决方案
select * from (
select rank() over(partition by region order by total) as rid
,orderid,region,sales,total
from salesorder ) t
where t.rid = 1
解决方案二:
select * from salesorder
where sales="张%" and total="5000000"
查询符合姓张 和总计达到5000000 的条件
解决方案三:
select min(sales) from salesorder group by region
解决方案四:
SELECT a.* FROM (SELECT id, region, sales, SUM(total) AS total FROM salesorder GROUP BY sales ORDER BY total) a GROUP BY a.region
解决方案五:
select s.* from
salesorder s,
(
select min(total) t,orderid from salesorder group by region
) a
where s.orderid=a.orderid and a.t=s.total
解决方案六:
select s.* from
salesorder s,
(
select min(total) t,region from salesorder group by region
) a
where s.region=a.region and a.t=s.total
解决方案七:
select region,min( total) from salesorder
group by region
解决方案八:
select region,min(total) from salesorder
group by region
解决方案九:
select * from (
select rank() over(partition by region order by total) as rid
,orderid,region,sales,total
from salesorder ) t
where t.rid = 1
解决方案十:
select * from (
select rank() over(partition by region order by total) as rid
,orderid,region,sales,total
from salesorder ) t
where t.rid = 1
时间: 2024-12-02 04:28:01