Answers for "ora-00979 not a group by expression in oracle 19c"

SQL
8

ora-00979 not a group by expression in oracle 19c

SELECT a, b, sum(c) FROM my_table GROUP BY a;		-- Error
SELECT a, b, sum(c) FROM my_table GROUP BY a, b;	-- OK, all expressions there
-- CASE WHEN statement, for example:
SELECT a, CASE WHEN b=1 THEN 'Ok' ELSE 'Ko' END AS r, sum(c) 
FROM my_table
GROUP BY a, CASE WHEN b=1 THEN 'Ok' ELSE 'Ko' END;		-- No alias name (r)
Posted by: Guest on July-04-2021

Code answers related to "ora-00979 not a group by expression in oracle 19c"

Code answers related to "SQL"

Browse Popular Code Answers by Language