0

SQL double where

Trying to set 2 conditions, 1 for > avg price and the other for not rented. I succeeded at the desafío, but it wouldn’t have worked if one of the expensive apartments had been rented, because my code, below, only accounts for price, not status (rented or not): SELECT * FROM Apartments WHERE Price> (SELECT AVG (price) FROM Apartments) ORDER BY Apartments.Price I tried to add “WHERE Status LIKE ‘n%’” after the first where and before ORDER BY. I tried using AND WHERE and just AND. Neither would run.

17th Mar 2022, 3:16 PM
Caleb
1 Answer