select foo, bar from my_table where col < '''drop table my_table; --' or (col > 'def_val' and col3 < fgh_val) #### 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 #### my $ST = db->prepare(q{ 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 }); $ST->execute(123, 456, 'Mouse', 'Joe'); $ST->execute(149, 357, 'Mousepad', 'Joe');