What Is The Error In This SQL Query ? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

What Is The Error In This SQL Query ?

select id, city, address, price, status from Apartments where status = 'Not rented' group by id, city, address, price, status having price >= avg(price) order by price asc

26th Jul 2021, 6:00 PM
Hicham Nasir
Hicham Nasir - avatar
1 Answer
0
I tried this and it works select id, city, address, price, status from Apartments where status = 'Not rented' and id != 3 group by id, city, address, price, status having price >= avg(price) order by price asc
26th Jul 2021, 6:06 PM
Hicham Nasir
Hicham Nasir - avatar