Multiple-argument aggregate functions

You have a table ABC with columns a and b. You now want to use a multiple-argument aggregate function to display a in descending order of b. To do this, you have written the following two queries.


SELECT string_agg(a, ‘,’ ORDER BY b) FROM ABC;


SELECT string_agg(a ORDER BY b, ‘,’) FROM ABC;

Which of these queries is an incorrect way to implement the given objective?

  1. Only A
  2. Only B
  3. Both A and B
  4. Neither A nor B

Related Posts

Close Bitnami banner