tags:

views:

145

answers:

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.

+3  A: 

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
  .... 
René Nyffenegger