HELPLIB.HLB  —  RDML72  Statements  AVERAGE  Examples  Pascal Example
    program average_function (input,output);
    DATABASE PERS = FILENAME 'PERSONNEL';

    var
    mean : double;
    begin
    READY PERS;
    START_TRANSACTION READ_ONLY;

    GET
      mean = AVERAGE SH.SALARY_AMOUNT OF SH IN SALARY_HISTORY
             WITH SH.SALARY_AMOUNT > 50000.00;
    END_GET;

    COMMIT;

    writeln ('Average is: ', mean:10:2);

    FINISH;
    end.
Close Help