Skip to content
Advertisement

Create a function that accepts a string and returns multiple rows

I’m being required to create a function that transforms a single column’s value based on the user’s input. I need some help on the syntax for doing so.

Here is the query I’m currently performing to get the rows:

enter image description here

some pseudocode on what I’m trying to do:

I’ve been trying to create one but I’m struggling with the syntax.
Does not work:

Could someone please help me with the syntax to creating this function?

Advertisement

Answer

Something like this

It does return in the form of a table if you use

Here a demo

demo in db<>fiddle

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement