这是我的SQL命令行版本。在Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 122
Server version: 5.0.95 Source distribution
我有一个表,在Python中,我希望将最后一列写为null。最后,特定行的最后一列将得到一个日期戳,我将用它作为标志,不再处理该行。在
^{pr2}$
如何将null放入insert查询字符串?换句话说,我不知道如何在Python查询字符串中表示NULL。在sql_cmd = \
"""insert into cs_remove
(
Action, EndpointId, DeviceType, ChannelNumber, ActionDate, InsertDate
)
VALUES
(
%s, %s, %s, %s, %s, %s
)
"""
print(base_date)
sql_data = ('R', ept_id, ept_type, ept_ch, "NULL", base_date);
该示例最后将0000-00-00放入日期字符串中。我要空的。我可以从mysql命令行执行此操作,但不能从Python执行。任何帮助都将不胜感激。在