我有一个具有这种结构的表:
CREATE TABLE `jos_cpnllist` (
`MSTMLSNO` int(7),
`CLTIME` TIMESTAMP NULL,
PRIMARY KEY (`MSTMLSNO`))
ENGINE=MyISAM
SELECT * FROM jos_mls AS mls
INNER JOIN jos_activeagents AS active ON mls.MSTLISTBRD = active.AGENTUID
INNER JOIN jos_agents AS agents ON active.AGENTUID = agents.AGTBRDIDMM;
然后我想定期更新此表中的数据:
INSERT INTO jos_cpnllist
SELECT * FROM jos_mls AS mls
INNER JOIN jos_activeagents AS active ON mls.MSTLISTBRD = active.AGENTUID
INNER JOIN jos_agents AS agents ON active.AGENTUID = agents.AGTBRDIDMM;
当我进行更新时,添加的时间戳列给我带来了麻烦:
ERROR 1136 (21S01): Column count doesn't match value count at row 1
有没有办法解决这个问题而无需专门列出SELECT
? 告诉它忽略CLTIME
时间戳列?
注意:这就像 75 列数据,所以我想避免列出所有这些。该MSTMLSNO
列已存在于jos_mls
表中,因此不会引发错误。CLTIME
是大 INNER JOIN 语句中唯一不存在的列。