1

Here's what I want to do:

Insert some data being passed into a procedure into a new table, but also include some data from another table too.

Example:

INSERT INTO my_new_table(name, age, whatever) VALUES (names.name, ages.age, passed_in_data);

But that won't work.

I did check another question on here, but it was a bit much for my feeble brain.

1 Answer 1

3

Something like this should do it:

insert into my_new_table (
  name,
  age,
  whatever
)
select 
  names.name,
  ages.age,
  passed_in_data
from
  names   inner join
  ages on ....
where
  .... 
Sign up to request clarification or add additional context in comments.

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.