0
Did anybody solve the "Apartmebts" code project in SQL course?!
It gives me.back some.mistakes. i think i need your help :)
10 Answers
+ 2
Thats because you cannot compare the value in a cell to that of an arbitrary value unless it is equal. For the price, for have to say:
WHERE price>(SELECT AVG(price) from Apartments)
That should work
+ 1
select * from Apartments where price > AVG(price) and status = 'Not rented' order by price;
+ 1
SELECT *
FROM Apartments
WHERE price >
(SELECT AVG(price) FROM Apartments)
ORDER BY price;
0
Please show your attempt. I have done it fine
0
select * from Apartments where price > AVG(price) and status = 'Not rented' order by price;
0
It worked mate. Thank you very much for clearance of it.
0
No problem
0
Also, slight rewording of the reason, itâs because the average is not a set value, its dependant on the table, and so a custom column have to be created for comparison
0
Hm i see. Thanks a lot friend. Thats lots of help
0
:D