0

I'm looking for a way to quickly process some table in mysql 5.0.X. I'd like to insert a row into t1 for each row in t2. Essentially, I'd like something like this to map over every row:

REPLACE INTO t1 VALUES (CONCAT('blah/', (select username from t2)), 'value')

Is that possible without procedures?

2 Answers 2

1

Something like this should work for you:

REPLACE INTO t1
SELECT CONCAT('blah/',username), 'value'
FROM t2
Sign up to request clarification or add additional context in comments.

Comments

1

Sounds like you are looking for the INSERT SELECT statement unless I am misunderstanding. Check this link for details.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.