We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e51d347 commit 05e9e4aCopy full SHA for 05e9e4a
classes/32-functions.sql
@@ -83,13 +83,22 @@ BEGIN
83
-- Calculations
84
possible_raise = job_max_salary - current_salary;
85
86
+ IF (possible_raise < 0) THEN
87
+ RAISE EXCEPTION 'Person with salary greater than max_salary: %', empl_id;
88
+ -- possible_raise = 0;
89
+ END IF;
90
+
91
RETURN possible_raise;
92
END;
93
$$ LANGUAGE plpgsql;
94
95
SELECT *
96
FROM max_raise_2(206);
97
-SELECT *
98
+SELECT
99
+ employee_id,
100
+ first_name,
101
+ salary,
102
+ max_raise_2(employee_id)
103
FROM employees
104
WHERE employee_id = 206;
0 commit comments