PL/SQL group orders by date and sum the total I need to group orders by date and sum the total,

My table looks like this :

TEST_DATE
TEST_ID - NUMBER
SUCC_ID - NUMBER


I need to group by date and sum the total, this is my query:

SELECT COUNT(*), TEST_ID, SUCC_ID
FROM MYTABS
GROUP BY TEST_DATE;


How can I?

thank you.
You can think of aggregate queries as two parts:


columns that are included in GROUP BY, and
columns that are included in aggregate functions, like SUM(), MAX(), COUNT(), etc.


To put things very simply, if the column is in the SELECT clause, it has to either appear in the GROUP BY or inside an aggregate function.

In your case, you're probably looking for this:

SELECT TEST_DATE,
       COUNT(TEST_ID) AS numberOfTestID,
       SUM(SUCC_ID) AS sumOfSuccID
FROM MYTABS
GROUP BY TEST_DATE;