2014-06-05 4 views
-1

하나의 SQL에서 다중 열을 테이블에 추가하는 방법은 무엇입니까?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

당신이 오류가 무엇인지 언급하세요? – Sadikhasan

+0

'products_new_type' 줄 끝에 쉼표가 누락되었습니다. – Barmar

답변

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 ; 
관련 문제