SQL Apartments | Sololearn: Learn to code for FREE!


SQL Apartments

Hello, I tried this query: https://pastebin.com/1AjhN55R The output is: id,city,address,price,status Where is my mistake?


2/17/2021 4:38:18 AM

Anis Ali Khan

8 Answers

New Answer


Here is my code You can try it. It surely help you. SELECT * FROM Apartments WHERE price>=(SELECT AVG(price)FROM Apartments) ORDER BY price;


Anis Ali Khan Problem is with SQL Compiler not your script. https://www.sololearn.com/post/935054/?ref=app



Most welcome 👍


My code SELECT * FROM Apartments WHERE price > (SELECT AVG(price) FROM Apartments AND status != ‘Rented’ ORDER BY price;


thank you. I also had to delete the second subcondition.


Most welcome 👍


Thank you Sathe Prerana Satish