Update a table with multiple conditions

I am trying to update a table that has four columns.

I've tried the syntax: -
UPDATE table SET col4=value WHERE col1=val1, col2=val2, col3=val3;
but I get an error in syntax near col2=val2.

I've checked the MySQL documentation, but that only lists a single WHERE condition.

Is what I want to do possible, and if so how?

Gilgamoth
LVL 1
GilgamothAsked:
Who is Participating?
 
vk33Connect With a Mentor Commented:
Hi!

UPDATE table SET col4=value WHERE col1=val1 AND col2=val2 AND ...

Regards!
0
 
GilgamothAuthor Commented:
Damn, I knoew the answer would be simple.

Cheers
0
All Courses

From novice to tech pro — start learning today.