I’ve searched forums for a solution, but the examples aren’t making sense to me. I know my syntax is incorrect, but it’s the idea I’m trying to get across.
Assuming query was ran at 2012-03-09 24:00:00. (I think I edited dummy values correctly)
task_status is a view, running = (began > ended), ran=((now()-ended) < 10h)
select * from task_status;
+----------------+---------------------+---------------------+---------+------+
| task | began | ended | running | ran |
+----------------+---------------------+---------------------+---------+------+
| MIRRORS_SPLIT | 2012-03-09 19:15:48 | 2012-03-09 19:15:51 | 0 | 1 |
| NETWORK_BACKUP | 2012-03-09 19:25:01 | 2012-03-09 19:23:41 | 0 | 1 |
| TAPE_BACKUP | 2012-03-09 19:26:01 | 2012-03-09 23:16:32 | 0 | 1 |
+----------------+---------------------+---------------------+---------+------+
I’m having issues creating a BACKUPS row, began=(MIN(NETWORK_BACKUP.began, TAPE_BACKUP.began), and end=(MAX(NETWORK_BACKUP.end, TAPE_BACKUP.end). Running and ran should evaluate correctly then, right?
I want to add a row that results as such:
| BACKUPS | 2012-03-09 19:25:01 | 2012-03-09 23:16:32 | 0 | 1 |
Any help would be greatly appreciated.
Thank you, JustDanyul, that got me on the right track.
Here’s what I ended up using.