Skip to content
Advertisement

How to return custom record with calculated data

I want to return a custom empRecord row. How can I do this? Please do not change the select statement. Essentially I just want to return the name of an employee and a new rank.

Table I want:

Advertisement

Answer

A more typical use of a function would be something like this:

And then you invoke it like this:

But note the function takes a single input and responds with a single output. That is typically how developers use SQL functions in my experience.

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