We use analytics and advertising cookies to understand how the site is used and whether our ads on Facebook and Instagram work. They are set only if you accept. See our Privacy Policy for details.
id, title and priority of every ticket whose status is 'open', sorted by priority high, then medium, then low, and within the same priority by opened_on (oldest first). Priority is stored as text, so sorting on the column directly gives the wrong order.