尝试在MySQL中对表进行分区时遇到语法错误。尝试对常规分区使用这两种方法中的任何一种时都没有错误,仅通过子分区即可。是导致错误的最后两行,我有点迷茫。
我也尝试过将KEY切换为HASH,将LIST切换为RANGE为主分区,但是仍然会引发错误。
CREATE TABLE `map_polygon` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`district_id` int(10) unsigned NOT NULL DEFAULT '0',
`map_type_id` int(10) unsigned DEFAULT NULL,
`is_big_data` tinyint(1) DEFAULT '0',
`polygon_group` int(10) unsigned DEFAULT NULL,
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`sort_order` int(10) unsigned DEFAULT NULL,
`locations` mediumtext COLLATE utf8_unicode_ci,
`north` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL,
`south` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL,
`east` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL,
`west` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL,
`group_north` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL,
`group_south` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL,
`group_east` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL,
`group_west` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
`deleted_by_user_id` int(10) unsigned DEFAULT NULL,
`created_by_user_id` int(10) unsigned NOT NULL,
PRIMARY KEY (`id`,`district_id`, `is_big_data`),
KEY `map_polygons_created_by_user_id_foreign` (`created_by_user_id`),
KEY `map_polygons_deleted_by_user_id_foreign` (`deleted_by_user_id`),
KEY `map_polygons_map_type_id_foreign` (`map_type_id`),
KEY `map_polygons_district_id_foreign` (`district_id`),
KEY `is_big_data` (`is_big_data`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci
PARTITION BY LIST(is_big_data)
PARTITIONS 2 (
PARTITION pNormal VALUES IN (0),
PARTITION pBigData VALUES IN (1)
)
SUBPARTITION BY KEY(district_id)
SUBPARTITIONS 10;
答案 0 :(得分:1)
看起来(http://www.sqlfiddle.com/#!9/9d746)的分区子句只是重新排列了
Sub zapiszpdf2()
Dim DATA As String
DATA = Format(Date, "dd-mm-yyyy")
Columns("E:F").EntireColumn.Hidden = True
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
ActiveWorkbook.Path & "C_a_" & DATA & ".pdf", Quality:=xlQualityStandard, _
IncludeDocProperties:=True, IgnorePrintAreas:=False, From:=1, To:=1, OpenAfterPublish:=True
Columns("D:G").EntireColumn.Hidden = False