Advertisement: Over 100,000 Jobs Worldwide. Click here to find one for you.

MySQL FAQs
FAQs Categories
Client Server Commands
Database Structure
Table Types or Storage Engines
Indexes
SQL Statements
Table Joins
Funtions and Operators
Tricky Select Queries
Speed Up Queries
Data Back Up
General Questions
Errors
Send This Page to Friend
Enter Friend's Email
Enter Your Email
http://www.kareerlinks.com/jobs/skill/MySQL
 
Home / Errors / Question No: 13

Why I see an error when I EXPLAIN for update query?

I want to analyze my update query for optimizing purpose. But when I did so I got an error #1064 in response. Why I see an error when I EXPLAIN for update query? My query for which I tried is followed:
EXPLAIN UPDATE categories SET name='books' WHERE id =1;

Answer No: 13

Because EXPLAIN is used only with SELECT statements in MySQL that is why you were getting #1064 error while running EXPLAIN with UPDATE statement. So, there is no way to EXPLAIN UPDATE query. However, you can analyze your UPDATE query by converting it like this:
EXPLAIN SELECT name FROM categories WHERE id =1;

Comments
Add Comments
Found a bug? Or do you have a better solution for this? Feel free to leave a message:
Leave a comment
Your Name: Your Email Address (optional):
Comment:


Related MySQL FAQs to the Above FAQ

ERROR-1295-(HY000):-This-command-is-not-supported-in-the-prepared-statement-protocol-yet ERROR 1295 (HY000): This command is not supported in the prepared statement protocol yet

ERROR-1064-(42000):-You-have-an-error-in-your-SQL-syntax ERROR 1064 (42000): You have an error in your SQL syntax

1264-Out-of-range-value-adjusted-for-column 1264 Out of range value adjusted for column

1048-Column-cannot-be-null 1048 Column cannot be null

1093-You-can-not-specify-target-table-comments-for-update-in-FROM-clause 1093 You can not specify target table comments for update in FROM clause

1191-Cant-find-FULLTEXT-index-matching-the-column-list 1191-Cant find FULLTEXT index matching the column list