Jump to content

Archived

This topic is now archived and is closed to further replies.

brown2005

update

Recommended Posts

Hi,

I have:-

INSERT INTO table2 (letter) SELECT letter FROM table1 ORDER BY RAND()

which takes 26 records from table1 and inserts them into the letter field of table 2

but how can i

update exsisting records in table2 and not insert?

Share this post


Link to post
Share on other sites
i *think* this will work

UPDATE table2 SET `fieldname` = (SELECT letter FROM table1 ORDER BY RAND())


but i'm not 100 % on it

Share this post


Link to post
Share on other sites
Have a look at SELECT INTO [a href=\"http://www.w3schools.com/sql/sql_select_into.asp\" target=\"_blank\"]here[/a]

Share this post


Link to post
Share on other sites
i dont think select into is really what i want, but i might be wrong, as far as i can see that just creates a new table, but i dont want a new table.

the () in the query hasnt worked..

any other ideas please?

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.