[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1090
  • Last Modified:

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
0
Gilgamoth
Asked:
Gilgamoth
1 Solution
 
vk33Commented:
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

Featured Post

Transaction-level recovery for Oracle database

Veeam Explore for Oracle delivers low RTOs and RPOs with agentless transaction log backup and transaction-level recovery of Oracle databases. You can restore the database to a precise point in time, even to a specific transaction.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now