insert into my_table select ? as foo, ? as bar, c.id as product_id, d.price as product_price from my_stuff c where c.name=? join friend_prices d where d.name=? and c.class=d.class