SQL code question
From: Albert W. Dorrington <awdorrin_at_ictest.delcoelect.com>
Date: 1995/08/11
Message-ID: <40fug8$s5l_at_kocrsv08.delcoelect.com>#1/1
Date: 1995/08/11
Message-ID: <40fug8$s5l_at_kocrsv08.delcoelect.com>#1/1
Hi,
The query:
SELECT
'$thing' PART_TYPE,
(count(distinct(substr(TABLEB.rowid,1,8)||substr(TABLEB.rowid,15,4))))*512
Bytes,
count(*) Row_Count
FROM
TABLEA, TABLEB
WHERE
test_area = '$area'
AND
TABLEA.master_id = TABLEB.master_id
AND
TABLEB.master_id BETWEEN $time1 AND $time2
AND
part_type = '$thing';
The columns 'test_area' and 'part_type' are both in TABLEA.
Of course, $thing, $area, $time1 and $time2 are variables, that would be substitued.
Any advice or suggestions would be greatly appreciated.
Thanks,
-- Al Dorrington awdorrin_at_ictest.delcoelect.com Database Admin Delco Electronics - IC CIM Unix Sysadmin Kokomo, Indiana, USA Phone: 317.451.9655Received on Fri Aug 11 1995 - 00:00:00 CEST