I`m new in SQL and now straggling with an error 1054 Unknown column in 'where clause' in MySQL.
- There`s a simple table 'customer_orders' with 3 columns 'order_id', 'staff_id' and 'order_total'
- I needed to insert a line. My query was INSERT INTO customer_orders VALUES (25,1,10.50);
- First that worked, then I realized a need to delete the row and insert with a slight change
- Now it throws the error 'Error Code: 1054. Unknown column 'order_id' in 'where clause''
There
s no such column in the query and the column isnt mentioned. I renamed the column into 'order_id_new' and explicitly specified the column names in the INSERT statement - the same error.
INSERT INTO customer_orders (order_id_new, staff_id, order_total) VALUES (23,1,11.43);
When I created a copy of the table the same worked fine.
Any ideas what is wrong with the table?
Thanks in advance.
VALUES?INSERT INTO customer_orders (25,1,10.50);