Please enable / Bitte aktiviere JavaScript!
Veuillez activer / Por favor activa el Javascript![ ? ]
How to transfer a lot of data from SELECT statement in UPDATE? - bug-code.com Q&A

How to transfer a lot of data from SELECT statement in UPDATE?

0 like 0 dislike
31 views
For example, I make a sample:
SELECT id WHERE foo="bar"

All the data (a bunch of IDS) I want to make a column fieldname_one table tablename (fieldname_one, fieldname_two), while, to fill fieldname_two all the inserted Species a value of "123".

Tell me how it could be done? Is it possible at all?
asked by | 31 views

1 Answer

0 like 0 dislike
Update table set field='123' where id in(select id from table where foo='bar')

In General, Google does an excellent job of request: mysql update from select
answered by
Welcome to Bug-code Q&A, where you can ask questions and receive answers from other members of the community.

24.8k questions

46.2k answers

0 comments

13.3k users

24,788 questions
46,220 answers
0 comments
13,321 users