When activating codes above, I got an error message ("line 41" below means "line 16"):
Does anyone know how to fix it?
By the way, what are the ways if I want to add one new column in table variable in SQLScript functions (say, "temp_major_list" variable above)?
I try to ARRAY_AGG the existing two columns in the table variable first, and build one more column in array, and finally UNNEST all three arrays into a new table variable.
Any other suggestions?
Thank you and best regards,
Angel