Комментарии:
appreciate your effort
ОтветитьSo short, yet so precise. Thank you Alex.
ОтветитьIt’s almost like you don’t like Toby as much as Micheal
ОтветитьCommenting for traction as I continue learning, thanks as always for the videos!
ОтветитьHi Alex,
Thanks for the great explaination.
When I run this :
select
jobTitle,
avg(Salary) as avg_salary
from
EmployeeSalary
group by 1
having avg(Salary) > 42000;
I get error "Each GROUP BY expression must contain at least one column that is not an outer reference."
But this works fine
select
jobTitle,
avg(Salary) as avg_salary
from
EmployeeSalary
group by JobTitle
having avg(Salary) > 42000;
Do you know why "group by 1" doesnt work here.
Thank you Alex!
Ответитьrealy amasing i love it
Ответитьwhy should the having clause come above the order by claus in the average salary case
ОтветитьAlex, you're the real deal. Much love. Posterity willl definitely remember you
ОтветитьI’m getting HR as well with 50K average salary with the last query. Anybody else?
ОтветитьAs I go through the contents. I am amazed and taking all these small steps at its strides. Thank you once again
ОтветитьThank you Alex!
Ответитьbrilliant sir
ОтветитьI just have a question, can't we do HAVING count(JobTitle) even though we group by salary, isnt that possible? thank you
ОтветитьYo! What did Michael do to Toby in this video?
ОтветитьHelpful and really good explanation
ОтветитьCan someone explain to me why
SELECT JobTitle, AVG(Salary) AS avgsalary
FROM EmployeeDemographics
JOIN EmployeeSalary
ON EmployeeDemographics.EmployeeID = EmployeeSalary.EmployeeID
GROUP BY JobTitle
HAVING avgsalary > 45000
ORDER BY avgsalary
is not working and I have to change the HAVING avgsalary > 45000 to HAVING AVG(Salary) > 45000?
I just wanted to try other methods if I could use HAVING clause with the column names and not the (Argument)
Great job! Thanks
Ответить