0

I created a view that pulls Data from different tables and Views, and now I need to add an additional row summing the contents in 2 of the columns what the best way to generate this new row? I have tried SUM and Group BY, but that creates a new column identical to the column I want to sum.

                        NEW VIEW

    From table A    From Table B    From View A   From VIEW A   FROM TABLE C    From View A
    column A        column B          column C      column D    column E        column F
    1               10-20-2021         100        10-21-2021    728             9.53
    2               4-26-2020          124        4-26-2020     513             8.33
    3               3-12-2021          130        3-12-2021     783             9.16
    4               5-2-2021           98         5-3-2021      492             9.00
    5               8-19-2020          115        8-19-2020     386             8.13

                                       TOT                      TOT

1 Answers1

0

In your view, you presumably have group by.

If so, you can use grouping sets:

group by grouping sets ( (<current columns here>, () )

The () is a method to provide the total.

Note: Without sample code, it is hard to provide a more detailed answer.

Gordon Linoff
  • 1,242,037
  • 58
  • 646
  • 786