-4

I have several by number of dates and against them quantity. the goal is to total the quantity and show only the minimum date

   date       quantity
    
  13-SEP-15     5
  16-FEB-20     6
  16-FEB-21     100

  expected result;
          date          quantity
          13-SEP-15       111
     

1 Answers1

0

It's just two aggregates, nothing else.

Sample data:

SQL> with test (datum, quantity) as
  2    (select date '2015-09-13',   5 from dual union all
  3     select date '2020-02-16',   6 from dual union all
  4     select date '2021-02-16', 100 from dual
  5    )

Query:

  6  select min(datum) min_datum,
  7         sum(quantity) total
  8  from test;

MIN_DATUM      TOTAL
--------- ----------
13-SEP-15        111

SQL>
Littlefoot
  • 131,892
  • 15
  • 35
  • 57