dsgoj7457 2011-05-16 18:29
浏览 7

Mysql 2日期类型

Can I use 2 date type in 1 mysql table? because for some reason when I insert records for 2 different dates it doesnt work, only the first date is working the other one shows 00-00-00?

Thank you for your time and help

  • 写回答

1条回答 默认 最新

  • drqefnd544707688 2011-05-16 18:32
    关注

    I will assume you are using a TIMESTAMP data type, and you want it to default to CURRENT_TIMESTAMP.

    Only one TIMESTAMP column in a table can automatically be set on INSERT or UPDATE - and by default, MySQL goes with the first one.

    If you would like to have more than one TIMESTAMP column get updated automatically on INSERT or UPDATE, you will need to turn to triggers.

    The docs on the TIMESTAMP data type are a good read!

    Edit: if this educated guess does not answer your rather vaguely-phrased question, you will probably want to update your question with an example of the queries you are running, and what exactly is happening/not happening afterward.

    评论

报告相同问题?

悬赏问题

  • ¥15 Vue3 大型图片数据拖动排序
  • ¥15 划分vlan后不通了
  • ¥15 GDI处理通道视频时总是带有白色锯齿
  • ¥20 用雷电模拟器安装百达屋apk一直闪退
  • ¥15 算能科技20240506咨询(拒绝大模型回答)
  • ¥15 自适应 AR 模型 参数估计Matlab程序
  • ¥100 角动量包络面如何用MATLAB绘制
  • ¥15 merge函数占用内存过大
  • ¥15 使用EMD去噪处理RML2016数据集时候的原理
  • ¥15 神经网络预测均方误差很小 但是图像上看着差别太大