fix unit tests in stat dao v2
fix syntax error in SQL query