Parcourir la source

Modify the function to return the biggest quantity

DricomDragon il y a 5 ans
Parent
commit
664e290af8
1 fichiers modifiés avec 1 ajouts et 1 suppressions
  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;