I inherited a rather large database which contains several hundred columns of data, and for most of these columns, there is a metadata column which specifies whether the data in that column was based off of the response to a survey or merely estimated by using one of several codes. All of these metadata columns' name's begin with the letter x. I need to create a view that contains all of the data from the original table, with the exception that all of the metadata columns have a function performed on the data in them.
For example, if I were only doing this with two columns, it would look something like this:
Code:
CREATE ALGORITHM = UNDEFINED VIEW `my_view` AS
SELECT data1,
my_native_function(xdata1) AS 'xdata1',
data2,
my_native_function(xdata2) AS 'xdata2'
I need to do this with a few hundred columns, though. Does anyone know how?