DROP SHARDING TABLE RULE
语法用于删除指定逻辑库的指定分片规则。
DropShardingTableRule ::=
'DROP' 'SHARDING' 'TABLE' 'RULE' ifExists? ruleName (',' ruleName)* ('FROM' databaseName)?
ifExists ::=
'IF' 'EXISTS'
ruleName ::=
identifier
databaseName ::=
identifier
databaseName
时,默认是当前使用的 DATABASE
。 如果也未使用 DATABASE
则会提示 No database selected
;ifExists
子句用于避免 Sharding rule not exists
错误。DROP SHARDING TABLE RULE t_order, t_order_item FROM sharding_db;
DROP SHARDING TABLE RULE t_order;
ifExists
子句删除分片规则DROP SHARDING TABLE RULE IF EXISTS t_order;
DROP
、SHARDING
、TABLE
、RULE
、FROM