3 use FS::UID qw(adminsuidsetup);
4 use FS::Record qw(qsearch);
9 #select * from rate_prefix where 1 < ( select count(*) from rate_prefix as other where rate_prefix.countrycode = other.countrycode and ( rate_prefix.npa = other.npa or ( rate_prefix.npa is null and other.npa is null ) ) ) order by countrycode, npa;
13 'select' => 'DISTINCT ON ( countrycode, npa ) *',
14 'table' => 'rate_prefix',
15 'extra_sql' => ' where 1 < ( select count(*) from rate_prefix as other where rate_prefix.countrycode = other.countrycode and ( rate_prefix.npa = other.npa or ( rate_prefix.npa is null and other.npa is null ) ) )',
20 my @all = qsearch('rate_prefix', { map { $_=>$dup->$_() } qw( countrycode npa ) } );
22 my $first = shift(@all);
24 foreach my $extra (@all) {