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
1PLs Company - #1Payday.Loans Agency - Loans online and near me $100-$2500 (Same Day)
Powered by 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;

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

About FAQs: Recently Added FAQs

About MySQL FAQs: Site Map | Bookmark Us | Recommend this Site to Your Friend | Contact Us

Useful Links: Wikipedia.org | Oracle.com | w3schools.com | www.php.net | Github.com

© 2023  www.mysqlfaqs.net
All rights reserved.