소스 검색

Modify the function to return the biggest quantity

DricomDragon 5 년 전
부모
커밋
664e290af8
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  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;