Having an input parameter, for example num = 3, I want to create a string in MySQL, concatenated by ','.
In Python it would look like this:
num = 3
string = ['target_table']
for i in range(num):
string.append('hub_hid_column_' + str(i))
string.append('hub_hid_column_name_' + str(i))
print(','.join(string))
At the end i want to have the following output: target_table,hub_hid_column_0,hub_hid_column_name_0,hub_hid_column_1,hub_hid_column_name_1,hub_hid_column_2,hub_hid_column_name_2
How can i do it in MySQL? Ideally without a procedure.