Created
June 27, 2013 12:02
-
-
Save exhuma/5875917 to your computer and use it in GitHub Desktop.
Redmine query aimed at the "my page" route.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- The following query conbines the task due-date with the priority and sorts with the combined value. | |
SELECT id, project_id, subject, due_date, status_id,priority_id,author_id, priority_id * EXTRACT(EPOCH FROM AGE(due_date)) | |
FROM issues | |
WHERE assigned_to_id=3 OR | |
author_id=3 AND | |
status_id IN (SELECT id FROM issue_statuses WHERE NOT is_closed) | |
ORDER BY (priority_id * EXTRACT(EPOCH FROM AGE(due_date))) DESC NULLS LAST, | |
priority_id DESC; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment