SELECT
column_name AS '列名', data_type AS '数据类型', character_maximum_length AS '字符长度', numeric_precision AS '数字长度', numeric_scale AS '小数位数', is_nullable AS '是否允许非空',
CASE
WHEN extra = 'auto_increment'
THEN 1
ELSE 0
END AS '是否自增', column_default AS '默认值', column_comment AS '备注'
FROM
Information_schema.columns
WHERE table_Name = 'test_table' ;
var v=["OPERATING_INCOME",
"OPERATING_COST",
"BUSINESS_TAXADD",
"COST_SALES",
"MANAGEMENT_FEES",
"DEV_COST",
"FINANCE_CHARGES",
"INTEREST_PAYMENTS",
"NETEXCHANGE_LOSS",
"IMPAIRMENT_ASSETS",
"OTHER_INCOMES",
"BENEFAIR_VALCHA",
"DISPOSED_ASSETS",
"RETURN_INVESTMENT",
"INVEST_INCOME",
"OPERATING_PROFIT",
"NETRATING_INCOME",
"GOVERNMENT_SUBS",
"PROFIT_TOTAL",
"NET_PROFIT",
"NET_PROFITAT",
"TOTAL_ASSETS",
"CURRENT_ASSETS",
"MONETARY_FUND",
"NOTES_ACCOUNTS_RECEIV",
"ACCOUNTS_RECEIV",
"INVENTORY",
"RAW_MATERIAL",
"INVENTORY_GODWDB",
"TOTAL_AMOUNLI",
"CURRENT_LIABIL",
"NOTES_ACCOUNTS_PAYABLE",
"BANK_LOAN",
"BONDS_PAYABLE",
"TOTAL_EQUITY",
"ERSHIP_OWN",
"NETCASH_FLOWACT",
"TOTINTEREST_LIA",
"CAPINTEREST_EXP",
"TOTTAXES_PAYABLE",
"TOTTAXESFEES_PAID",
"EMPLOYEE_COMPENSN",
"GROSS_WAGES",
"TOTSALARY_STAFF",
"WORKER_NUMBER",
"NUM_EMPLOYEPOST",
"INVESTM_FIXEDAS",
"DEPRECIAT_AMOUNT",
"GROSS_LABDUCT",
"GROSSIL_OUTVALUE",
"ILSALES_VALUE",
"EXPORT_SALEREVE",
"NEWPRODUC_VALUE"];
for(var i=0;i<v.length;i++){
console.info("a."+v[i]+" as '"+ v[i].toLowerCase().split("_").map(function(item, index) {
return index==0?item:(item.slice(0, 1).toUpperCase() + item.slice(1));
}).join('')+"',");
}