http://qs321.pair.com?node_id=318842


in reply to Perl solution for SQL problem?

Use an "update" statement with a correlated sub-query, e.g.
update geo_m_count g set person_count = ( select count(*) from cases c where <as per OP> )
No Perl required.

rdfield

Replies are listed 'Best First'.
Re: Re: Perl solution for SQL problem?
by Corion (Patriarch) on Jan 05, 2004 at 14:23 UTC

    Unless denormalization is really needed, I wouldn't do this - I would either create a view or leave the query as a subselect, depending on the features of the underlying DB.

    Of course, it might be prudent to cache that information, as the database load will be not really small if queries hit person_count often, but I don't see Win hitting that part yet.

    perl -MHTTP::Daemon -MHTTP::Response -MLWP::Simple -e ' ; # The $d = new HTTP::Daemon and fork and getprint $d->url and exit;#spider ($c = $d->accept())->get_request(); $c->send_response( new #in the HTTP::Response(200,$_,$_,qq(Just another Perl hacker\n))); ' # web
A reply falls below the community's threshold of quality. You may see it by logging in.