Home > database >  Mysql query results can be as the field name of another table
Mysql query results can be as the field name of another table

Time:09-18

RT: a table to store the field name and comments, such as the following statement:
The select group_concat (CONCAT (a.c olumn_name, 'as', b. ` DESC `)) as the dd from information_schema. The COLUMNS of a join TD_OA. Bpm_variable b on a.c olumn_name=b.n ame where a.T ABLE_NAME=' bpm_data_15 '
The result is:
data_m239 as 填表日期,data_m240 as 姓名,data_m241 as 部门,data_m242 as 职务,data_m243 as 出生日期,data_m244 as 籍贯,data_m245 as 学历,data_m246 as 身份证,data_m247 as 入职,data_m248 as 工号,data_m249 as 手机,data_m250 as 邮箱,data_m251 as 是否有照片,data_m252 as 是否有档案表,data_m253 as 是否有身份证,data_m254 as 是否有学位证,data_m255 as 其他证件,data_m256 as 分配电话,data_m258 as 人事部经办人,data_m259 as 分配电子邮件,data_m260 as 开设OA账号,data_m261 as 分配电脑,data_m263 as 系统经办人,data_m264 as 指纹考勤,data_m265 as 基本办公用品登记,data_m267 as 行政经办人,data_m269 as 部门经办人,data_m271 as 总经理经办人,data_m273 as 新员工经办人
And the result is bpm_data_15 fields in this table, my idea is to put English field into Chinese, seems intuitive,
But not with the following statement
SELECT the replace (SELECT group_concat (CONCAT (a.c olumn_name, 'as', b. ` DESC `)) as the dd from information_schema. The COLUMNS of a join TD_OA. Bpm_variable b on a.c olumn_name=b.n ame where a.T ABLE_NAME=' bpm_data_15 '), '\ "', ' ') from bpm_data_15
Want to ask, can the query results into a table recognition field? Thank you first,
  • Related