List:General Discussion« Previous MessageNext Message »
From:Sasha Pachev Date:May 30 1999 4:22am
Subject:Re: Multiple counts as an array
View as plain text  
How about this:

You first initialize a Perl associative array %counts setting the value
for each description to 0. Then run select count(*), descript from t1
group by descript, iterate through the results setting the values of the
associative array. Then iterate through the array and print out the
results. The items that were not there will have the count of 0. This
should be faster than the left join if you have only 12 items to deal
with.

-- 
Sasha Pachev
http://www.sashanet.com
Thread
Multiple counts as an arrayDarren Sweeney30 May
  • Re: Multiple counts as an arrayJim Faucette30 May
  • Re: Multiple counts as an arrayAlexander I. Barkov30 May
    • LIKE or = ?Stefan Schmiedl31 May
  • Re: Multiple counts as an arrayJim Faucette30 May
  • Re: Multiple counts as an arrayGraham Ashton30 May
Re: Multiple counts as an arrayDarren Sweeney30 May
  • Re: Multiple counts as an arrayJim Faucette30 May
  • Re: Multiple counts as an arrayJim Faucette30 May
Re: Multiple counts as an arrayDarren Sweeney30 May
  • Re: Multiple counts as an arraySasha Pachev30 May