Solved

Update a table with multiple conditions

Posted on 2003-11-05
2
1,070 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
2 Comments
 
LVL 4

Accepted Solution

by:
vk33 earned 125 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

As a database administrator, you may need to audit your table(s) to determine whether the data types are optimal for your real-world data needs.  This Article is intended to be a resource for such a task. Preface The other day, I was involved …
Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL (http://www.experts-exchange.com/articles/201/Handling-Date-and-Time-in-PHP-and-MySQL.html) several years ago, it seemed like now was a good time to updat…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

758 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now