user3609435
user3609435

Reputation: 9

Query cannot be parsed, please check the syntax of your query

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

Answers (3)

hudsonb
hudsonb

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

kevinkrs
kevinkrs

Reputation: 108

Try this

SELECT area, status, price_le, location FROM stores WHERE status = 'rented' ORDER BY location;

Upvotes: 1

Joachim Isaksson
Joachim Isaksson

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

Related Questions