Explorar o código

Modify the function to return the biggest quantity

DricomDragon %!s(int64=5) %!d(string=hai) anos
pai
achega
664e290af8
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      SQL/plpgsql/create_biggest_ordered_quantity.sql

+ 1 - 1
SQL/plpgsql/create_biggest_ordered_quantity.sql

@@ -3,7 +3,7 @@ $$
 DECLARE
     ans INTEGER;
 BEGIN
-    SELECT ori_quantity FROM OrderedItem WHERE ori_id = 1 INTO ans;
+    SELECT ori_quantity FROM OrderedItem ORDER BY ori_quantity DESC INTO ans;
 
     RETURN ans;
 END;