Results 1 to 6 of 6
  1. #1
    Join Date
    Jun 2006
    Posts
    63

    Unanswered: How to rectify a wrong entry?

    Hi folks,

    I ran following commands
    mysql> USE AAADatabase

    mysql> INSERT INTO domains VALUES ('www.aab.org','/var/www/www.aaa.net/web/');

    It should be;
    Code:
    INSERT INTO domains VALUES ('www.aaa.net','/var/www/www.aaa.net/web/');
    Please advise how to correct it? TIA

    B.R.
    satimis

  2. #2
    Join Date
    Nov 2003
    Posts
    2,933
    Provided Answers: 12
    Code:
    UPDATE domains
       SET the_unknown_column = 'www.aaa.net'
     WHERE the_unknown_column = 'www.aab.org';
    More details in the manual: http://dev.mysql.com/doc/refman/5.5/en/update.html

  3. #3
    Join Date
    Jun 2006
    Posts
    63
    Quote Originally Posted by shammat View Post
    Code:
    UPDATE domains
       SET the_unknown_column = 'www.aaa.net'
     WHERE the_unknown_column = 'www.aab.org';
    More details in the manual: MySQL :: MySQL 5.5 Reference Manual :: 12.2.11 UPDATE Syntax
    Hi,

    Thanks for your advice and link.

    mysql> UPDATE domains
    -> SET the_unknown_column = 'www.aaa.net'
    -> WHERE the_unknown_column = 'www.aab.org';
    ERROR 1054 (42S22): Unknown column 'the_unknown_column' in 'where clause'

    B.R.
    satimis

  4. #4
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    so what did you call the column that contained 'www.aaa.com'
    shammat was saying he didn't know and called it 'the_unknown_column'

    if it was called hosts
    so that would read
    update domains set hosts = 'www.aab.net' where hosts = 'www.aab.org';
    I'd rather be riding on the Tiger 800 or the Norton

  5. #5
    Join Date
    Nov 2003
    Posts
    2,933
    Provided Answers: 12
    Quote Originally Posted by satimis View Post
    mysql> UPDATE domains
    -> SET the_unknown_column = 'www.aaa.net'
    -> WHERE the_unknown_column = 'www.aab.org';
    ERROR 1054 (42S22): Unknown column 'the_unknown_column' in 'where clause'
    That'll teach you to always post the correct table definitions.

  6. #6
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    Quote Originally Posted by shammat View Post
    That'll teach you to always post the correct table definitions.
    i wonder if he'll finally get the message

    check out this thread and also this one

    LOL !!!

    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •