ISPN-3497 getCountRowsSql() has wrong SQL syntax

https://issues.jboss.org/browse/ISPN-3497