如何在一个sql中将多列添加到表中?
这个sql下载错了,怎么解决?
alter table jy_products add column
`products_new_type` int(11) NOT NULL DEFAULT 1
`products_image_host` tinyint(1) NULL DEFAULT 1 ,
`tpl_key` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT 'p1' ,
`rushorder` tinyint(2) NOT NULL ,
`products_viewed` int(11) NOT NULL DEFAULT 0 ,
`likes` int(11) NOT NULL DEFAULT 0 ,
`comments` int(11) NOT NULL DEFAULT 0 ,
`wishlists` int(11) NOT NULL DEFAULT 0 ,
`shares` int(11) NOT NULL DEFAULT 0 ,
`lookbooks` int(11) NOT NULL DEFAULT 0 ,
`products_popular` float(11,1) NOT NULL DEFAULT 0.0 ,
`status_off_date` datetime NULL DEFAULT NULL
答案 0 :(得分:1)
alter table jy_products
add column `products_new_type` int(11) NOT NULL DEFAULT 1 ,
add column `products_image_host` tinyint(1) NULL DEFAULT 1 ,
add column `tpl_key` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT 'p1' ,
add column `rushorder` tinyint(2) NOT NULL ,
add column `products_viewed` int(11) NOT NULL DEFAULT 0 ,
add column `likes` int(11) NOT NULL DEFAULT 0 ,
add column `comments` int(11) NOT NULL DEFAULT 0 ,
add column `wishlists` int(11) NOT NULL DEFAULT 0 ,
add column `shares` int(11) NOT NULL DEFAULT 0 ,
add column `lookbooks` int(11) NOT NULL DEFAULT 0 ,
add column `products_popular` float(11,1) NOT NULL DEFAULT 0.0 ,
add column `status_off_date` datetime NULL DEFAULT NULL ;