I have the following insert query with a subquery:
INSERT INTO Order (time_of_purchase, cust_id)
VALUES (NOW(), (SELECT cust_id FROM Customer WHERE first_name = "John" AND last_name = "Doe")) RETURNING reference_number
When I execute the query, postgres returns the error: "ERROR: column "John" does not exist. SQL state: 42703. Character: 110
What could be the problem?
"identifier"and'string'.