User defined function to look up value of a table column using a value in another column
I would like to write a function that would return the value of a particular column from a table using the value of another column as input.
Here are some rows from my table:
2 New York
3 Los Angeles
I want the function to return Chicago if I call myfunction(1), New York if I call myfunction(2) and so on ...
Can someone please guide me how to write such a function? I am using Vertica 8.0.1-3