创建表 , 关键词 : BROADCAST
CREATE TABLE `financial_product_yjw` (
`ID` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT ‘产品ID‘,
`ACCESS_CHANNEL` tinyint(4) DEFAULT ‘0‘ COMMENT ‘接入渠道‘,
`PRODUCT_NAME` varchar(50) NOT NULL COMMENT ‘产品名称‘,
`PRODUCT_TYPE` tinyint(4) DEFAULT ‘0‘ COMMENT ‘产品类型 0为线下产品,2为微理财产品,3.散标产品,4.悟空理财产品,5.微理财按月付息产品‘,
`PRODUCT_PERIOD` int(11) DEFAULT NULL COMMENT ‘产品期限‘,
`PRODUCT_PERIOD_UNIT` varchar(20) NOT NULL COMMENT ‘产品期限单位‘,
`PRODUCT_PRIORITY` tinyint(4) DEFAULT ‘0‘ COMMENT ‘产品优先级‘,
`EXPECTED_INCOME` decimal(36,16) NOT NULL COMMENT ‘预期收益率‘,
`INCOME_RATE_NAME` varchar(60) NOT NULL COMMENT ‘收益率名称‘,
`INCOME_TYPE` tinyint(3) unsigned NOT NULL DEFAULT ‘0‘ COMMENT ‘收益类型‘,
`REDEEM_TIME_TYPE` tinyint(3) unsigned NOT NULL DEFAULT ‘0‘ COMMENT ‘赎回日期算法类型‘,
`CONTINUE_LOAN_STATUS` tinyint(3) unsigned NOT NULL DEFAULT ‘0‘ COMMENT ‘是否续出借 0不是 1是‘,
`DELETE_STATUS` tinyint(3) unsigned NOT NULL DEFAULT ‘0‘ COMMENT ‘是否删除0正常 1删除‘,
`EXPECTED_INCOME_TYPE` tinyint(3) unsigned NOT NULL DEFAULT ‘0‘ COMMENT ‘预期收益类型‘,
`MICRO_FINANCIAL_ID` int(10) unsigned NOT NULL COMMENT ‘微理财产品ID‘,
`ACTIVE_STATUS` tinyint(4) DEFAULT ‘0‘ COMMENT ‘是否启用 0启用 1未启用‘,
`MODIFIEDBY` varchar(32) NOT NULL COMMENT ‘修改用户‘,
`MODIFIEDON` datetime NOT NULL COMMENT ‘修改时间‘,
`CREATEDBY` varchar(32) NOT NULL COMMENT ‘创建用户‘,
`CREATEDON` datetime NOT NULL COMMENT ‘创建时间‘,
PRIMARY KEY (`ID`),
KEY `idx_yjw_prd_id` (`MICRO_FINANCIAL_ID`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8 BROADCAST;
使用例子
/*TDDL:node=scan*/
update BB_JYLS_new b set b.source_product_code = (select MICRO_FINANCIAL_ID from financial_product_yjw t where t.ID=b.source_product_code);