var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
I have a database full with stock 1 – minute result.
I want to take out per date the lowest in LOW and IF more than once per date.
The result I’m interested of is date, time and low.
Result with: SELECT Date, ROUND(MIN(Low),2) AS Low FROM test.ABB GROUP BY Date DESC;
`Date` date NOT NULL,
`Time` time NOT NULL,
`Open` float NOT NULL,
`High` float NOT NULL,
`Low` float NOT NULL,
`Close` float NOT NULL,
`Vol` float NOT NULL,
PRIMARY KEY (`Date`,`Time`)
Problem is that I want all result of min(LOW) if It take place more than once per date. How do I best “loop” it so I get the result I want? Temp Table?
Solved, or one of many solutions.
select a.date, a.time, round(a.low,2) as low
from abb a
select date, min(low) as low
group by date
) b on a.date=b.date and a.low=b.low
order by a.date asc, a.time asc, a.low desc;