+ $Level = '>';
+ };
+ # prepare and execute query: get list of newsgroups meeting level condition
+ $DBQuery = $DBHandle->prepare(sprintf("SELECT newsgroup FROM %s.%s WHERE %s GROUP BY newsgroup HAVING MAX(postings) %s ?",$Conf{'DBDatabase'},$Conf{'DBTableGrps'},$WhereClause,$Level));
+ $DBQuery->execute($StartMonth,$EndMonth,@GroupList,$Options{'l'})
+ or die sprintf("$MySelf: E: Can't get groups data for %s to %s from %s.%s: %s\n",$StartMonth,$EndMonth,$Conf{'DBDatabase'},$Conf{'DBTableGrps'},$DBI::errstr);
+ # add newsgroups to a comma-seperated list ready for IN(...) query
+ my $GroupList;
+ while (my ($Newsgroup) = $DBQuery->fetchrow_array) {
+ $GroupList .= ',' if (defined($GroupList) and $GroupList ne '');
+ $GroupList .= "'$Newsgroup'";