SELECT MIN(volume_count) as Min_volume_count FROM tableName WHERE date= 'yourdate'
例
SELECT MIN(volume_count) as Min_volume_count FROM tableName WHERE date= '2018-03-01'
另一种选择是使用窗口函数min()
例
Select *
,MinVol = min(Volume) over ()
,Change = Volume - min(Volume) over ()
from YourTable
返回
Date Volume MinVol Change
2018-03-01 581 581 0
2018-02-22 9480 581 8899
2018-02-15 10082 581 9501
2018-02-08 10082 581 9501
2018-02-01 10504 581 9923
select ddate, min(volume) as mmin
from table
group by ddate
order by ddate