If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > How to rectify a wrong entry?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-16-11, 12:29
satimis satimis is offline
Registered User
 
Join Date: Jun 2006
Posts: 56
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
Reply With Quote
  #2 (permalink)  
Old 04-16-11, 12:31
shammat shammat is offline
Registered User
 
Join Date: Nov 2003
Posts: 2,407
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
Reply With Quote
  #3 (permalink)  
Old 04-16-11, 12:42
satimis satimis is offline
Registered User
 
Join Date: Jun 2006
Posts: 56
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
Reply With Quote
  #4 (permalink)  
Old 04-16-11, 13:11
healdem healdem is offline
Jaded Developer
 
Join Date: Nov 2004
Location: out on a limb
Posts: 9,250
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 my Versys or my Tiger 800 let alone the Norton
Reply With Quote
  #5 (permalink)  
Old 04-16-11, 13:26
shammat shammat is offline
Registered User
 
Join Date: Nov 2003
Posts: 2,407
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.
Reply With Quote
  #6 (permalink)  
Old 04-16-11, 15:50
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,525
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 !!!

__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On