Wouldn't you usually do that in your reporting software? Or on any layer on top of the database?

In MS Access I've done it using a custom function which stores the last value and then only outputs the next value if it is different. Not sure how to do that in H2 ? Probably via a custom function again?

I'm not sure of other ways to make 1 row aware of the previous rows value so you can run a calculation off it.

Can you put it into a temp table with row numbers, then join the temp table to itself in a query to get the previous rows date value, then run a calculation off that whether to display the date or not?


On 10/01/2014 5:43 AM, Cecil Westerhof wrote:
I have the following SQL:
SELECT   date                  AS Date
,        SUBSTRING(time, 1, 2) AS Hour
,        MIN(idleTime)         AS `Min Idle`
,        MAX(idleTime)         AS `Max Idle`
,        COUNT(*)              AS SUM
FROM     vmstatDefault
GROUP BY Date
,        Hour
ORDER BY Date
,        Hour
;

This works fine, but I would prefer to only have Date shown when it is different as the previous Date. Is this possible?

--
Cecil Westerhof
--
You received this message because you are subscribed to the Google Groups "H2 Database" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to