?
Solved

Update a table with multiple conditions

Posted on 2003-11-05
2
Medium Priority
?
1,088 Views
Last Modified: 2006-11-17
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
Comment
Question by:Gilgamoth
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 4

Accepted Solution

by:
vk33 earned 500 total points
ID: 9686336
Hi!

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

Regards!
0
 
LVL 1

Author Comment

by:Gilgamoth
ID: 9686398
Damn, I knoew the answer would be simple.

Cheers
0

Featured Post

Learn how to optimize MySQL for your business need

With the increasing importance of apps & networks in both business & personal interconnections, perfor. has become one of the key metrics of successful communication. This ebook is a hands-on business-case-driven guide to understanding MySQL query parameter tuning & database perf

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article, we’ll look at how to deploy ProxySQL.
In this article, I’ll talk about multi-threaded slave statistics printed in MySQL error log file.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question