Deals Of The Week - hours only!Up to 80% off on all courses and bundles.-Close
Returning tables and sets
Summary
10. Exercise 2

Instruction

Great job! Give this one a try.

Exercise

Create a new function that returns the name of the topic with the most posts along with the actual number of posts in that topic.

The function will be named get_most_popular_topic() and should have two OUT parameters:

  • OUT topic_name varchar.
  • OUT count_of_posts bigint.

Stuck? Here's a hint!

You can use RETURNS SETOF record along with the RETURN QUERY statement and OUT parameters.