insert into workflow_fsm_states (state_id, workflow_id, sort_order, short_name, pretty_name) values (:state_id, :workflow_id, :sort_order, :short_name, :pretty_name) select workflow_id, sort_order, short_name, pretty_name from workflow_fsm_states where state_id = :state_id select state_id from workflow_fsm_states where short_name = :short_name and workflow_id = :workflow_id