酷代码 AI
菜单
全部AI  /  热门  /  AI写代码神器
服务商

create table `py_plan_opportunity_point` ( `id` bigint not null auto_increment comment '主键id', `location_code` varchar(32) character set utf8mb4 collate utf8mb4_0900_ai_ci not null comment '规划点/机会点编码', `location_name` varchar(20) character set utf8mb4 collate utf8mb4_0900_ai_ci default null comment '规划点名称', `point_type` char(2) character set utf8mb4 collate utf8mb4_0900_ai_ci default null comment '点类型(1:规划点/2:机会点)', primary key (`id`) using **ree, key `py_plan_opportunity_point_uniq

It looks like your table creation statement was cut off or had a typo. You were defining an index but the syntax is incomplete. Below is the corrected version assuming you want a unique index on `location_code` and `point_type`. ```sql CREATE TABLE `py_plan_opportunity_point` ( `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键id', `location_code` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '规划点/机会点编码', `location_name` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '规划点名称', `point_type` char(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '点类型(1:规划点/2:机会点)', PRIMARY KEY (`id`), UNIQUE KEY `py_plan_opportunity_point_uniq` (`location_code`, `point_type`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; ``` This SQL statement creates a table called `py_plan_opportunity_point` with fields `id`, `location_code`, `location_name`, and `point_type`. It also includes a primary key on `id` and a unique constraint on the combination of `location_code` and `point_type`. This ensures that each combination of location code and point type is unique within the table. [2024-09-04 16:07:48 | AI写代码神器 | 328点数解答]

相关提问