追加每两列进单个列从同一个表中MYSQL
问题描述:
dt1 transaction_1 dt2 transaction_2 dt3 transaction_3....dt80 tra_80
may01 22 jun01 56 Aug09 73
sep02 49 feb12 53 dec23 80
现在应该有如下追加每两列进单个列从同一个表中MYSQL
dt transaction type
may01 22 transaction_1
sep02 49 transaction_1
jun01 56 transaction_2
feb12 53 transaction_2
Aug09 73 transaction_3
dec23 80 transaction_3
.... .. ......
.... .. ......
... .. transaction_80 PLZ任何人在MYSQL提供查询。 感谢,
答
使用此功能CONCAT(string1, string2)
例如:
SELECT CONCAT(dt, transaction) FROM table_name
选择CONCAT(列1, '',列2) –