[Chicago-talk] Database or Code?

Richard Reina richard at rushlogistics.com
Mon Jun 29 09:34:25 PDT 2009


This query turned out to be just what I needed thank you very much.


---- Chicago.pm chatter <chicago-talk at pm.org> wrote:
>
> Whoops, missed by carrier.
> 
> Select airline, depart, arrive, count(*) from flights group by airline, depart, arrive;
> 
> -----Original Message-----
> From: imran javaid <imranjj at gmail.com>
> Sent: Saturday, June 27, 2009 3:55 PM
> To: Chicago.pm chatter <chicago-talk at pm.org>
> Subject: Re: [Chicago-talk] Database or Code?
> 
> There are many ways to slice and dice this. One is to build a hash of hashes:
> $data->{$airline}->{$origin}->{$destination}++
> 
> 
> 
> On 6/27/09, Richard Reina <richard at rushlogistics.com> wrote:
> > I have to create a summary report out of a database that contains data about
> > flight departures.
> >
> > Example:
> >
> > Chicago, IL Phoenix, AZ United
> >
> > Each report has to summarize an airline's quantity of unique monthly flights
> >  so that in the end I get:
> >
> > Continental Airlines:
> > Chicago, IL to New York 21
> > New York, NY to Dallas 17
> > Houston, TX to Dallas 45
> > Chicago, IL to Phoenix 5
> >
> > I can't find an SQL query that allows me to parse the data in such a way so
> > I was wondering if I could get some general opinions on what would be the
> > easiest way to do this in perl?
> > _______________________________________________
> > Chicago-talk mailing list
> > Chicago-talk at pm.org
> > http://mail.pm.org/mailman/listinfo/chicago-talk
> >
> 
> -- 
> Sent from my mobile device
> _______________________________________________
> Chicago-talk mailing list
> Chicago-talk at pm.org
> http://mail.pm.org/mailman/listinfo/chicago-talk
> 
> _______________________________________________
> Chicago-talk mailing list
> Chicago-talk at pm.org
> http://mail.pm.org/mailman/listinfo/chicago-talk
> 


More information about the Chicago-talk mailing list