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++; } }
In reply to Whether to perl or oracle by tradez
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |