add distinct support to insertselect