[Solved] why does simple update query in mysql keeps giving error code 1064?
Looking to automatically optimize YOUR SQL query? Start for free.

EverSQL Database Performance Knowledge Base

why does simple update query in mysql keeps giving error code 1064?

Database type:

This is the query:

update table tblprobleem set omschrijving='bugfixes' where probleem_id=4;

I checked omschrijving, its datatype is varchar. probleem_id is integer. I tried to rewrite it a thousand times, I just don't get what is wrong with this.

error message:

12:03:05 update table tblprobleem set omschrijving='bugfixes' where probleem_id=4

Error Code: 1064. You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'table tblprobleem set omschrijving='bugfixes' where probleem_id=4' at line 1 0.000 sec

If anybody has the answer, you have my thanks forevere.

Greetz, John

How to optimize this SQL query?

The following recommendations will help you in your SQL tuning process.
You'll find 3 sections below:

  1. Description of the steps you can take to speed up the query.
  2. The optimal indexes for this query, which you can copy and create in your database.
  3. An automatically re-written query you can copy and execute in your database.
The optimization process and recommendations:
  1. Create Optimal Indexes (modified query below): The recommended indexes are an integral part of this optimization effort and should be created before testing the execution duration of the optimized query.
Optimal indexes for this query:
ALTER TABLE `table` ADD INDEX `table_idx_probleem_id` (`probleem_id`);
The optimized query:
SELECT
        tblprobleem.omschrijving 
    FROM
        table tblprobleem 
    WHERE
        tblprobleem.probleem_id = 4

Related Articles



* original question posted on StackOverflow here.