$criteria = new Criteria();
$criteria->addSelectColumns(MemberPeer::ID);
$criteria->addSelectColumns('count(*)');
$criteria->add(MemberPeer::SEX, 2, Criteria::EQUAL);
$criteria->add(MemberPeer::STATUS, 1, Criteria::EQUAL);
$criteria->addGroupByColumn(MemberPeer::AGE);
$result = BasePeer::doSelect($criteria, $dbConnection);
$criteria->clear();