SQL Apartments | Sololearn: Learn to code for FREE!

0

SQL Apartments

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

sql

2/17/2021 4:38:18 AM

Anis Ali Khan

8 Answers

New Answer

+10

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;

+3

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

+2

+1

Most welcome 👍

+1

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

0

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

0

Most welcome 👍

-1

Thank you Sathe Prerana Satish