| 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 array | Darren Sweeney | 30 May |
| • Re: Multiple counts as an array | Jim Faucette | 30 May |
| • Re: Multiple counts as an array | Alexander I. Barkov | 30 May |
| • LIKE or = ? | Stefan Schmiedl | 31 May |
| • Re: Multiple counts as an array | Jim Faucette | 30 May |
| • Re: Multiple counts as an array | Graham Ashton | 30 May |
| • Re: Multiple counts as an array | Darren Sweeney | 30 May |
| • Re: Multiple counts as an array | Jim Faucette | 30 May |
| • Re: Multiple counts as an array | Jim Faucette | 30 May |
| • Re: Multiple counts as an array | Darren Sweeney | 30 May |
| • Re: Multiple counts as an array | Sasha Pachev | 30 May |
