I would use the SQL server to make the counts for me... or you could take the query then make a hash using the first three digits as the key and make the value increment... then you just hash through the hash (hehehe) and get your final count...
-----Original Message-----
From: steve silvers [mailto:[EMAIL PROTECTED]]
Sent: Friday, June 27, 2003 8:52 AM
To: [EMAIL PROTECTED]
Subject: DBI Count Distict
Quick question I'm calling out a column called data which looks like so:
001A
001B
002A
002D
003D
003E
004A
005
I need to get the count of all 001 and 002 and 003... so on where 001 = 2
and 002 = and 004 = 1...
I have
$sql = "SELECT Data FROM table";
while (($Data) = $sth->fetchrow_array) {
print "$Data \n";
}
Any help greatly appreciated.
Thanks in advance
Steve
_________________________________________________________________
Tired of spam? Get advanced junk mail protection with MSN 8.
http://join.msn.com/?page=features/junkmail
_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs