Order a MySQL query by fastest response time

I have a SQL query: SELECT number, ResponseTime, TicketCreateTime, round(time_to_sec(timediff(ResponseTime, TicketCreateTime))/60,2) AS FRMins FROM (SELECT TE.id, T.number, T.ticket_id, TE.thread_id, TE.pid, T.created AS TicketCreateTime, TE.created AS ResponseTime, TE.type, TE.staff_id FROM ost_ticket T INNER JOIN ost_thread_entry TE ON T.ticket_id = TE.thread_id WHERE TE.type = ‘N’ OR TE.type = ‘R’ AND TE.id IN (SELECT min(id) FROM ost_thread_entry WHERE…

Details

Ruby: run rake task to execute ruby scripts

I have a bunch of Ruby scripts and I’d like to start them with a Rake task. A simplified version to illustrate my issue: export_stats.rake: desc ‘Export statistics’ task :export_stats do puts “executing: export_stats.rb #{START_MONTH} #{END_MONTH} #{OUTPUT} #{ENVIRONMENT}” ruby “export_stats.rb #{START_MONTH} #{END_MONTH} #{OUTPUT} #{ENVIRONMENT}” end rake aborted! elk-stack/export_stats.rake Don’t know how to build task ‘export_stats’…

Details