Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Adding an element to an array

by AppleFritter (Vicar)
on Oct 14, 2015 at 18:51 UTC ( [id://1144901]=note: print w/replies, xml ) Need Help??


in reply to Adding an element to an array

If you're pulling data from an SQL database, the best approach may be to let the database do the work for you; SQL has a COUNT aggregate function. Something along the following lines, perhaps:

SELECT Name, COUNT(Home) AS HomeCount FROM People GROUP BY Name;

Replies are listed 'Best First'.
Re^2: Adding an element to an array
by Anonymous Monk on Oct 14, 2015 at 19:24 UTC
    Unfortunately I cant use the database for this one, since it is already too complex, I need to try using Perl.

      There are plenty of ways to unobtrusively change the statement already being used. Can you show us the SQL statement used to pull the data?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1144901]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2024-04-25 17:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found