Browse Source

Modify the function to return the biggest quantity

DricomDragon 5 years ago
parent
commit
664e290af8
1 changed files with 1 additions and 1 deletions
  1. 1 1
      SQL/plpgsql/create_biggest_ordered_quantity.sql

+ 1 - 1
SQL/plpgsql/create_biggest_ordered_quantity.sql

@@ -3,7 +3,7 @@ $$
 DECLARE
 DECLARE
     ans INTEGER;
     ans INTEGER;
 BEGIN
 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;
     RETURN ans;
 END;
 END;