Solved

Update a table with multiple conditions

Posted on 2003-11-05
2
1,072 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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

Introduction In this article, I will by showing a nice little trick for MySQL similar to that of my previous EE Article for SQLite (http://www.sqlite.org/), A SQLite Tidbit: Quick Numbers Table Generation (http://www.experts-exchange.com/A_3570.htm…
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 …
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…

920 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

15 Experts available now in Live!

Get 1:1 Help Now