use

.defaultview.totable(distinct as boolean, paramarray()) version to get distinct rows from table