tradez has asked for the wisdom of the Perl Monks concerning the following question:
And the following perl doing simple iterations on the array returned :my $sql = "select power_level, decode(power_level,null,'NA',decode(sig +n(power_level-30),-1,'1', decode(sign(power_level-40),1,'2','3'))) from wbr_power where host_name in ( select host_name from hosts where market_id = '$market' )";
There must be someway through joins and count() or sum() to do this all on the oracle end. But like I said, still pretty wet in the SQL relm. Please help.my ($lessThan, $inBetween, $greaterThan) = 0; foreach my $code (@powerCodes) { if ($code->[1] eq '1'){ $lessThan++; }elsif ($code->[1] eq '2'){ $inBetween++; }elsif ($code->[1] eq '3'){ $greaterThan++; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Whether to perl or oracle
by VSarkiss (Monsignor) on Feb 27, 2002 at 18:17 UTC | |
by tradez (Pilgrim) on Feb 27, 2002 at 19:16 UTC | |
|
Re: Whether to perl or oracle
by mr.dunstan (Monk) on Feb 27, 2002 at 18:46 UTC | |
by tradez (Pilgrim) on Feb 27, 2002 at 19:15 UTC |