I have a table with id, TYPE, NUMBER, DATE
example, no date:
1 a 15
2 c 10
3 b 11
4 b 14
5 a 19
6 c 1
7 b 14
8 b 7
SELECT 1:
I want to select 1 last record of each type ... so the result will be:
5 a 19 15.2.2014 16:00
8 b 7 15.2.2014 16:50
6 c 1 15.2.2014 17:00
NOW it is 02.15.2014 17:01
SELECT 2:
I want to select the maximum of "SELECT 1" from each last type in the last 60 minutes (try not to do this as "select from (SELECT 1)", the result will be:
8 b 7 15.2.2014 16:50
Can someone help me?
source
share