correct a bug on sql result datatable
rewrite statistics
minor fix