Posted on:

01 May 2024

0

Hi, I have a question

this my query:

USE employees;
USE employees;
DROP PROCEDURE IF EXISTS emp_avg_salary;

DELIMITER $$
CREATE PROCEDURE emp_avg_salary(IN p_emp_no INTEGER)
BEGIN
   SELECT
   e.first_name,e.last_name,AVG(s.salary)
   
   FROM
   employees e
   JOIN
   salaries s ON e.emp_no = s.emp_no
    WHERE
    e.emp_no=p_emp_no;
END $$
DELIMITER ;
CALL emp_avg_salary(11300); I have received this error 0
4
15:54:05
CALL emp_avg_salary(11300)
Error Code: 1140. In aggregated query without GROUP BY, expression #1 of SELECT list contains nonaggregated column 'employees.e.first_name'; this is incompatible with sql_mode=only_full_group_by
0.000 se , I have been repeatedly receiving this error recently, please help!!




0 answers ( 0 marked as helpful)

Submit an answer