Scope of v_avg_salary
Just to clarify:
We 'call' a user-defined function by using the SELECT statement, followed by the function name, then its input/s enclosed with a pair of parenthesis.
However, when you run the query
SELECT v_avg_salary in 3:10, the error code 1054 only indicates that "You don't have a field/column named v_avg_salary", it doesn't say that "You use the function incorrectly". Is that right?
1 answers ( 0 marked as helpful)
Thanks for reaching out.
Yes, it means that Workbench does not find such a variable. Actually, there is such a variable but it is of another scope, not the global.
Hope this helps.
Submit an answer
Resolved: SQL Task- getting the names of all the managers who have an AVG salary of 85k+
why was GROUP BY function not used with ROUND(AVG(salary)) in solving the task???