Re: [SQL*Forms 3.0] select DISTINCT possible?
Date: 1996/11/06
Message-ID: <55qpam$gks_at_panix3.panix.com>#1/1
In <55q6bu$7r7_at_knot.queensu.ca> 3srf_at_qlink.queensu.ca (Frampton Steve R) writes:
>From SQL*Plus, I can accomplish this with:
> select distinct(absn_reason_code),
> sum(total_override_crdt_loss)
> from ec_employee_absn_summary
> group by absn_reason_code
> order by absn_reason_code;
>I assume such a thing *is* possible? Any advice would be greatly appreciated.
It is possible.
From SQL*Plus, create a view:
create or replace view employee_absn_reason_code as
select absn_reason_code, sum(total_override_crdt_loss)
from ec_employee_absn_summary
group by absn_reason_code
Now base the block in SQL*Forms (any version) on the view, and set the default WHERE clause / ORDER BY to "order by absn_reason_code".
Voi la.
-- Andrew Finkenstadt, The Printing House Ltd, Also a GEnie Sysop "By the time they had diminished from 50 to 8, the other dwarves began to suspect 'Hungry' ..." -- Gary Larson, "The Far Side"Received on Wed Nov 06 1996 - 00:00:00 CET