Improved sample with replacement, also fixed a bug

bug: forgot to add sort$str in as.db.data.frame,db.Rquery-method