Jump to content
HumbleApprentice

SQL ALTER command

Recommended Posts

Hi can someone please tell me why I am getting an error message with this ALTER STATEMENT. I entered the wrong isbn number in my table and would like to change it. The version of mySQL that I am using is 5.5.20-log. Thanks. ALTER TABLE classics WHERE title ='Little Dorrit' CHANGE isbn = '9780141439969';

Share this post


Link to post
Share on other sites

To help clarify, ALTER TABLE changes the structure of the table, UPDATE changes the data in the table.

  • Like 1

Share this post


Link to post
Share on other sites

Hi Guys, I tried UPDATE but it does not work. Here is the error message: #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 classics WHERE title ='Little Dorrit' CHANGE isbn = '9780141439969'' at line 1 I get the same message when I use ALTER

Share this post


Link to post
Share on other sites

You don't use the words "table" or "change" in an update query, check some of the examples in the link above.

Share this post


Link to post
Share on other sites

Thanks Guys, Problem solved. The UPDATE STATEMENT fixed it. Here is the code: UPDATE classics SETisbn = '9780141439969'WHERE title = 'Little Dorrit' ;

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...