8148 sqlquery aggregate

Modifyed  testAggregate due to a deprecation