473,841 Members | 1,671 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How move content fieldA to fieldB WHEN fieldC='X'

2 New Member
I tried:
UPDATE `tablename` SET `fieldA` = `fieldB`
WHERE fieldC = 'X';

in different combinations of fieldnames with/without _`_

I got: "Getroffen rijen: 0 (Query duurde 0.0011 sec)".

In normal language:
The group tablerows where fieldC has the value X
should have the content of fieldB in fieldA.

I found the technical term 'self-join' but
couldnt do much with it.\(Neither did I find examples that came close.

TIA4 any help ...

JanHolland
Dec 22 '06 #1
3 1210
ronverdonk
4,258 Recognized Expert Specialist
I ran the same update and it worked perfectly allright, as it should, with and without back-ticks!
Expand|Select|Wrap|Line Numbers
  1. UPDATE `tablename` SET `fieldA` = `fieldB` 
  2. WHERE fieldC = 'X';
  3.  
Maybe your fieldC does not contain a value 'X' or has a different data type.

Ronald :cool:
Dec 22 '06 #2
JanHolland
2 New Member
Another provider with a more modern MySQL
reported:
"MySQL answered:


#1054 - Unknown column 'X' in 'where clause'"
Dec 23 '06 #3
ronverdonk
4,258 Recognized Expert Specialist
Can't be that modern. How do you get an 'unknown column X' where you don't use a column X? You must use a different query then the one shown.

Ronald :cool:
Dec 23 '06 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

0
1816
by: Helge | last post by:
Hi there I have a question regarding http://www.chriss.no/test. The <div id="rightcorner"> doesn't move up to where it should be in Internet Explorer. The HTML is like this: <div id="right"> <div id="content">
2
2098
by: Kenneth Koski | last post by:
Hello All, I have a comma delimited text file, which I would like to move into a SQL 2000 table . I created a DTS package in SQL Server and saved it as a VB.bas . I am writting the code in C# and I though that I might be able to change a few lines and keep the bulk of the code. However , it seems that there is a pretty big change in how VB is written and how C#.net is written. Does anyone have an example of using DTS and C# to move a few...
15
1750
by: Yogi_Bear_79 | last post by:
Visual Studio .NET started complaing when the array was around 4000. I found that if I pasted the array in via notepad then opened Visual Studio it would work. Now my array is over 26,000 and Visual Studio just doesn't like it. Everytime I open the prokect I get the following error: "An Error occurred which the C# comipler is unable to report due to low memory or possible heap corruption. It is recommended that you save all your files,...
1
1949
by: Philip Wagenaar | last post by:
How can I move a printjob from one printqueue to another. The printqueue's both have the same printerdriver.
10
3104
by: Robert | last post by:
I have an app that was originally 1.1, now migrated to 2.0 and have run into some sporadic viewstate errors...usually saying the viewstate is invalid, eventvalidation failed or mac error. My web config does specify a machinekey setting: <machineKey validationKey="447C05E8B3A71401CC4CAE5513A7F1A3494A3618EE819316AAD1D58433F236A759D66FB4154500E01EB4E1BC1DE42046E2D652D391CB8367A1649438867A02EB"...
6
2300
by: fidodido | last post by:
I was asked to do this.... Dynamically move "text1" and "hidden1" into the "form1" ..... Not by creating new elements, but moving the "text1" and "hidden1" elements into the form using javascript, after i click the submit button.... So if i loop the "form1", i can get the values for "text1" and "hidden1" too..... Is that possible ?
0
1298
by: Scott Abel | last post by:
Astoria Software's Move to DITA: An Interview with Chip Gettinger In this exclusive interview, TheContentWrangler.com asked Chip Gettinger, VP Services and Sales Support at Astoria Software, an XML content management software vendor, about his company's experience moving to the Darwin Information Typing Architecture (DITA). Gettinger says of DITA, "It's all about reducing the time, cost and risk associated with producing content." Read...
13
1853
by: Mounir | last post by:
Hi, Assume that right and left are multiple select elements. It's about the following line : right.options=left.options; It copies the content of left.options into right.options, but *removes* the content of the first one !
0
2498
by: prasenjit2007 | last post by:
I have a main form for inputing the (to/from/mesg/file) with the following code:- <html> <body> <table> <tr> <td>To:</td> <td><input type="text" name="to" size="50" value="pras_sandilya@rediffmail.com"></td> </tr>
0
9865
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10927
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10667
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9446
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5691
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5880
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4498
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4082
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3140
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.