The 365 Data Science team is proud to invite you to our own community forum. A very well built system to support your queries, questions and give the chance to show your knowledge and help others in their path of becoming Data Science specialists.
Ask
Anybody can ask a question
Answer
Anybody can answer
Vote
The best answers are voted up and moderated by our team

Error with the codes provided in the lectures

Error with the codes provided in the lectures

Super Learner
0
Votes
1
Answer

Hi, 
I copied the following codes from the exercise regarding the HAVING lecture: 
SELECT
   *, AVG(salary)
FROM
   salaries
WHERE
   salary > 120000
GROUP BY emp_no
ORDER BY emp_no;
 
SELECT
   *, AVG(salary)
FROM
   salaries
GROUP BY emp_no
HAVING AVG(salary) > 120000;
 
However, when I run them through MySQL it gives me an error:
“Error code 1055: Expression #2 of SELECT list is not in GROUP BY clause and contains nonaggregated columns  ’employes.salaries.salary’ which is not functionally dependent on columns in GROUP BY clause, this is incompatible with sql_mode=only_full_group_by”
Please help.
 

1 Answer

365 Team
0
Votes

Hi Lisa!
Thanks for reaching out and letting us know you encounter error code 1055 at this stage of the course.
We have addressed this issue later. Please refer to the following lecture and then retry running your queries.
https://365datascience.teachable.com/courses/360102/lectures/11680913 
Hope this helps.
Best,
Martin

×
LAST CHANCE
Ready to Learn Data Science?
50% OFF