Subject | Re: [ib-support] SUM + row_count |
---|---|
Author | Helen Borrie |
Post date | 2002-11-22T11:33:29Z |
At 12:24 PM 22-11-02 +0100, you wrote:
declare variable answer integer;
declare variable rows_in_total integer;
begin
Select sum("Col_1"), count("col_1") into :answer, :rows_in_total
where "col_2" = '2';
....
In DSQL:
Select sum("Col_1") as Total, count("col_1") AS answer
where "col_2" = '2';
heLen
>Hi,In a stored procedure:
>
>What is SQL way to know how many rows was selected to make SUM in following
>situation:
>
>SELECT SUM("col_1") FROM "table" where "col_2"="2" INTO :"answer";
declare variable answer integer;
declare variable rows_in_total integer;
begin
Select sum("Col_1"), count("col_1") into :answer, :rows_in_total
where "col_2" = '2';
....
In DSQL:
Select sum("Col_1") as Total, count("col_1") AS answer
where "col_2" = '2';
heLen