[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

Re: Multi Level ON-BREAK



If this is a summary report, you would be better off doing a SELECT
DISTINCT on the three fields and using a count column:

begin-select distinct
FIELDA
FIELDB
FIELDC
COUNT(*) &count
from your_table
group by fielda, fieldb, fieldc
end-select

MRS RALINE D SMITH-REID wrote:
>
> I am a new SQR programmer using SQR3.  Currently, I am creating a
> program that produces a count of UNIQUE PRODUCTS for each ACCOUNT.  A
> product is identified by 3 fields on a table.
>
> I have created a control-break process to accomplish this task.  My
> break is on the ACCOUNT and the CONCATENATED PRODUCT (the 3 product
> fields).
>
> Can someone tell me if the above can be done with the ON-BREAK
> command and if so an example would be appreciated.  Also, which would
> be more efficient when the query has the potential of capture more
> than 50,000 records. Creating a control-break process or using the ON-
> BREAK command.
>
> Thanks,
> Raline Reid