简体   繁体   中英

How to add new column name in existing table

Currently I am trying to send email with csv file which includes data from a table, in csv file (not in the actual table database) I want add new column "cop" with some calculated value. I am able to add new data but I can not add column name to that column.

I tried to use "AS" is not working ..

SELECT $table_row, $cop_configure AS cop FROM data_to_use WHERE device_key = '$device_key'

here pic of csv file what I am getting currently

在此处输入图片说明

thanks...

您必须更改退出表,然后添加新列

ALTER TABLE `tablename` ADD cop VARCHAR(60);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM