fix sql order for history monthly query
adapt time operation sql to local h2 driver
fix tests according stub data change