0
DECLARE 
eno integer := 0;
emp string ;

select into eno emp_no from "public"."salaries" GROUP BY emp_no ORDER BY max(salary) DESC LIMIT 1;
-- gives the emp_no of the employee with maximim salary

select INTO emp CONCAT(first_name, ' ' , last_name) as "Name" from "employees" 
WHERE emp_no = eno;
-- gives the name of the employee with the emp_no from preveous result 

raise NOTICE "The Employe with maximum salary is %",emp;

Error message : ERROR: syntax error at or near "integer"

i tried to get the emp name with maximum salary please help

1

1 Answer 1

0

You need to separate your declarations from your initialization of values.

Do this:

DECLARE 
   eno integer;
BEGIN
   eno := 0;
... rest of your code here
END;
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.