– 创建虚拟列
alter table act_hi_procinst modify column BUSINESS VARCHAR(100) GENERATED ALWAYS AS (SUBSTRING_INDEX(BUSINESS_KEY_,’:’, 1));
– 构建索引
alter table act_hi_procinst add index idx_bukey(BUSINESS);
解释:act_hi_procinst (表名)
BUSINESS (虚拟列)
SUBSTRING_INDEX(BUSINESS_KEY_,’:’, 1) (需要拆分的列值)
select * from act_hi_procinst where BUSINESS=‘contractChangeRecordClerkApproval’;
驱动表:https://blog.csdn.net/u013065023/article/details/54964275