From 23574c77900699184823762884c446b2373f168e Mon Sep 17 00:00:00 2001 From: Hugo Peixoto Date: Tue, 1 Aug 2023 19:58:31 +0100 Subject: [PATCH] Fix query to work in postgresql --- main.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.rb b/main.rb index 1b1c227..93f6c7c 100644 --- a/main.rb +++ b/main.rb @@ -39,7 +39,7 @@ get '/' do SELECT COUNT(1) AS total, SUM(size) AS bytes - FROM (select size from downloads group by video_id) as x; + FROM (select MAX(size) AS size from downloads group by video_id) as x; ")[0] videos = ActiveRecord::Base.connection.execute("select count(1) AS total from videos;")[0]