+1 vote
in Databases by (15.9k points)

What is wrong in this sql as it gives an error: ERROR:  column "Metadata" does not exist 

select * from concept where domain_id="Metadata" limit 4;

1 Answer

+2 votes
by (88.8k points)
selected by
 
Best answer

The error message 'column "Metadata" does not exist' indicates that the SQL query is trying to treat "Metadata" as a column instead of a string literal. In SQL, string literals must be enclosed in single quotes ('), not double quotes (") as double quotes (") are used for column names and identifiers.

Here is the corrected SQL query:
SELECT * FROM concept WHERE domain_id = 'Metadata' LIMIT 4;

...