如何将1行数据插入另一个表单列

时间:2017-06-12 11:23:54

标签: mysql

我有两张不同的牌桌, 第一个表结构:

`requestId` int(11) NOT NULL AUTO_INCREMENT,
 `correlationId` text NOT NULL,
 `processRegistryId` int(11) NOT NULL,
 `createdDateTime` datetime NOT NULL,
 `lastUpdatedDateTime` datetime NOT NULL,
 `status` text NOT NULL,
 `requestPayload` text NOT NULL,

第二个表结构:

`id` int(11) NOT NULL AUTO_INCREMENT,
 `primaryValidatedRequestId` int(11) DEFAULT NULL,
 `transferOutId` int(11) DEFAULT NULL,
 `policyNumber` varchar(50) DEFAULT NULL,
 `correlationId` varchar(50) DEFAULT NULL,
 `createdDateTime` datetime DEFAULT NULL,
 `OMIMAGE` varchar(255) DEFAULT NULL,
 `suspendedCase` varchar(255) DEFAULT NULL,
 `futureDated` varchar(255) DEFAULT NULL,
 `isprocessed` tinyint(1) DEFAULT NULL,

现在我想将数据插入到第一个表中,如requestId是主键,correlationId来自第二个表,processRegistryId是硬编码,createdDateTime现在是时间戳,{{ 1}}也是一些日期时间戳,lastUpdatedDateTime为硬编码, 但是来到status,数据应该是所有列数据,作为第二个表中的字符串。

0 个答案:

没有答案