473,322 Members | 1,526 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

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

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 1192
ronverdonk
4,258 Expert 4TB
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
Another provider with a more modern MySQL
reported:
"MySQL answered:


#1054 - Unknown column 'X' in 'where clause'"
Dec 23 '06 #3
ronverdonk
4,258 Expert 4TB
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
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...
2
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#...
15
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...
1
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
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...
6
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,...
0
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...
13
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...
0
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" ...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.