Excellent,Rudy, and I don't think it inappropriate at all. After it sounds as though it will be of great value to us all. The link from Uncle G was http://oreilly.com/catalog/9780980455250/
Odd it should be O'Reilly. I seem to recall quite a strong argument with him at Rhode Island on my...
Thanks for the explanation, and the recommendation,ingresman. Yes, I probably do have the picture wrong.
I will look out for that book - not my favourite collection, I must say - but of course I have many, but never find the precise wording of the query I'm after each time.
It's a problem...
I think the penny is dropping. Thank you very much. You can't say where a group of changes must be inserted (updated into) only hope they will be inserted near the point you want.
Thanks very much for that. I follow much better. And thanks for the reassurance. Very good of you.
Seems to me now that the code suggested would, as it were, tack the information updated onto the end of the table.
Trouble is, I am hoping to put that data into empty columns in an equal number...
Easy to make fun of people who want to learn and haven't quite grasped it. I probably use the wrong terms at times, and I apologise for that.
I used the word 'move' because I thought it would show you best what I am trying to do.
And I am grateful for your sticking with this. But I can't see...
Am I using the IN operator in the wrong place? Apologies if so. I want to move the data of a few columns in the same table to the same columns but in another part of the table.
And I thought I could the IN operator (with the ID numbers) to specify which of the rows the data is in, and use the...
Is there a way to move data from field1, field2, field3, field4, id IN(200, 201, 202, 203, 204) in table1
to field1, field2, field3, field4, id IN(800, 801, 802, 803, 804) in table1
Ideally the data would be moved rather than duplicated.
Is this possible, please, Experts?
Sorry to belabour this. But it is important because I have long wanted to be able to do it, and often need to do it.
INSERT
INTO table1
( id
, name1,name2,name3, another4 )
SELECT 5
, name1,name2,name3, another4
FROM table1
WHERE id = 4
Do you mean like that, please...
Sorry, r937, then I am a bit more lost than I thought. The primary key in the table is the id field. Sorry, but I don't know how I would use it for this query. Could you show me the way, please?
Thanks very much, Rudy. I adapted your code because I wanted to duplicate ALL of the contents of that particular field. I made it
------
INSERT
INTO table1
SELECT *
FROM table1
WHERE id = 4 ;
-------
and it worked. Does that look the right way to code it when it is all of a field...
To explain perhaps a little better about repeating the row in the same table ... id '4' has information I want to duplicate (so I can make alterations to the orginal).
If I try ...
UPDATE `table1` set id '4' = id '5';
it doesn't work. How should it be coded, please?
I need to insert into a different table, but to specify the IDs of the receiving table. Is this possible, please?
Something like ...
insert into table2 (row1, row2,row3)where id IN( 100,1001,1002)
select row1, row2, row3 from table1 where special_number = '9';
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.