【问题标题】:Incorrect integer value: '' for column不正确的整数值:列的“”
【发布时间】:2013-09-07 04:05:57
【问题描述】:

以下查询有什么问题? 我想将一些字段从一个表复制到另一个。

INSERT INTO `dle_post_plus` 
(
   `news_id`, `news_read`, `allow_rate`, `rating`, 
   `vote_num`, `votes`, `view_edit`, `access`, 
   `editdate`, `editor`, `reason`, `user_id`
) 
SELECT `id`, `news_read`, `allow_rate`, `rating`, 
   `vote_num`, `votes`, `view_edit`, `access`, 
   `editdate`, `editor`, `reason`, `user_id` 
FROM `dle_post` 
LEFT JOIN dle_users 
  ON (dle_post.autor=dle_users.name)

错误:

#1366 - Incorrect integer value: '' for column 'editdate' at row 1

【问题讨论】:

  • 同时发布两个表模式,可能某个值超出了列类型的所需范围。或者 int 列中的字符串值。确保两个表中的所有列都是相同的类型。

标签: mysql sql join insert


【解决方案1】:

确保两个表中的所有列都是相同类型。检查editdate。可能在 dle_post_plus 中的列是 INT 而在 dle_post 中是 varchar。

【讨论】:

  • 你是绝对正确的,一个是 varchar,另一个是 int。谢谢。
猜你喜欢
  • 2023-04-01
  • 1970-01-01
  • 1970-01-01
  • 2018-07-20
  • 2021-07-14
  • 1970-01-01
  • 2014-04-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多