SQL Function to return value from multiple columns
问题 I've been developing a few stored procedure and I have been repeating a portion of codes that derives a column based on a few other columns. So instead of copy this piece of code from one stored procedure to another, I'm thinking of having a function that takes the input columns and produces the output columns. Basically, the function goes as: SELECT columnA, columnB, columnC, myFunction(columnA, columnB) as columnD FROM myTable As we can see, this function will take column A and column B as