Reputation: 9
I have an error in my SQL syntax "Query cannot be parsed, please check the syntax of your query. (ORA-00904: "RENTED": invalid identifier)". How to solve this problem??
SELECT area,
status,
price_le,
location
from stores
WHERE status = rented
ORDER BY location;
Upvotes: 0
Views: 2768
Reputation: 2294
Without knowing more about your database schema - I assume you intended to test status against the string 'rented' in your where clause. To do that you need to surround rented in single quotes.
SELECT area, status, price_le, location
FROM stores WHERE status = 'rented'
ORDER BY location;
Upvotes: 2
Reputation: 108
Try this
SELECT area, status, price_le, location FROM stores WHERE status = 'rented' ORDER BY location;
Upvotes: 1
Reputation: 180867
Unless you have an actual table field called rented
that you want to compare to, you'll need to single quote it to have it be a string;
SELECT area, status, price_le, location
FROM stores WHERE status = 'rented' ORDER BY location;
Upvotes: 3