Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
This may be more of a sql question. Here is my code without my dbi connect.
my $query = "SELECT DISTINCT a.vol_id, a.vol_nbr, a.vol_mnt_req, a.vol_ser c.vol_juke, c.vol_stat FROM (select * from volume_index) a, (select * from volume_queue) c WHERE a.vol_id = c.vol_id AND a.vol_mnt_req is not null AND c.vol_stat != 'M' OR a.vol_mnt_req is not null AND a.vol_nbr != '1'"; my $data = send_recv($query); my (@rows) = split(/\n/, $data); foreach my $rows (@rows) { my ($id,$vnbr,$req,$ser,$juke,$stat) = split(/;/, $rows); print "$label $volnbr\n"; }
This works exactly how i want, but i like to have a count of total number of rows in the same query. Here is a few things of tried:
select distinct count(*) then the rest of the select statment.
from (select count(*) from volume_index) a,
(select * from volume_index) a,
(select * from volume_queue) c
Both failed. any help would be appreciated.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: oracle count
by crashtest (Curate) on Apr 27, 2006 at 00:47 UTC | |
|
Re: oracle count
by aufflick (Deacon) on Apr 27, 2006 at 01:43 UTC | |
|
Re: oracle count
by MFDoom (Novice) on Apr 27, 2006 at 01:12 UTC |