GeneCode
GeneCode

Reputation: 7588

MySQL Update First Row In Table

I have a table with single column.

EmailTable

NotifyEmail
[email protected]

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 [email protected]

It's not working.

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

Upvotes: 2

Views: 683

Answers (1)

Alessio Cantarella
Alessio Cantarella

Reputation: 5201

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 = '[email protected]'
WHERE NotifyEmail = '[email protected]';

Upvotes: 3

Related Questions