2

I have a table with single column.

EmailTable

NotifyEmail
mom@gmail.com

No id no nothing just single row single column. So how do I update this row with new value?

I tried:

UPDATE NotifyEmail
FROM EmailTable
SET dad@gmail.com

It's not working.

edit, my table do not have ID. It's just a single column.

Alessio Cantarella
  • 5,077
  • 3
  • 27
  • 34
GeneCode
  • 7,545
  • 8
  • 50
  • 85
  • Please don't ask a question for something like this that is readily available via a google or the appropriate manual section. – philipxy Feb 15 '18 at 02:30
  • @philipxy where in google can you solve my problem? If i have found in google or manual, i would'nt be asking in here. Pls refrain from commenting if you can't help. – GeneCode Feb 26 '18 at 02:19
  • Possible duplicate of [Change One Cell's Data in mysql](https://stackoverflow.com/questions/3024546/change-one-cells-data-in-mysql) – philipxy Feb 26 '18 at 02:44
  • See [ask] & [What types of questions should I avoid asking?](https://stackoverflow.com/help/dont-ask) & the downvote arrow mouseover text. Also [https://www.google.ca/search?q=So+how+do+I+update+this+row+with+new+value+mysql+stackoverflow.com](https://www.google.ca/search?q=So+how+do+I+update+this+row+with+new+value+mysql+stackoverflow.com). And [How do comments work?](https://meta.stackexchange.com/questions/19756/how-do-comments-work) – philipxy Feb 26 '18 at 02:57
  • @philipxy the answer at "Change One Cell's Data in mysql " does not answer my question since my table is only one column without any ID. Pls read carefully my question before suggesting unrelated answers. Thank you. – GeneCode Mar 02 '18 at 04:01
  • Hm :\ I see all the answers there and not as clear as the one given here.Sorry to disapoint. – GeneCode Mar 02 '18 at 07:12

1 Answers1

3

The MySQL UPDATE statement has the following syntax:

UPDATE table_name
SET column1 = value1, column2 = value2, ...
WHERE condition;

so, in your case, you should write the following query:

UPDATE EmailTable
SET NotifyEmail = 'dad@gmail.com'
WHERE NotifyEmail = 'mom@gmail.com';
Alessio Cantarella
  • 5,077
  • 3
  • 27
  • 34