【发布时间】:2021-07-19 11:50:11
【问题描述】:
使用“”将数据插入文本列时出现错误,当我删除引号然后 postgres 运行并添加值为 0 的列时。
INSERT INTO tablex (dates, times, openp, high, low, closep, volume)
VALUES ("03/08/2021", 2300, 1680, 1688.6, 1680, 1685.1, 12074);
列日期和时间都被定义为文本列。其他列被定义为 Float。
当我使用上述代码运行查询时,出现以下错误:
错误:列“03/08/2021”不存在
第 4 行:(“03/08/2021”、2300、1680、1688.6、1680、1685.1、12074);
当引号被删除时,列日期填充为 0 值
我该如何解决这个问题?
【问题讨论】:
-
您需要将表示日期的字符串放入单引号 -
'03/08/2021'
标签: sql postgresql sql-insert string-constant