【发布时间】:2016-12-03 18:30:19
【问题描述】:
日期以 varchars 形式存储在另一个表中
select wkdocre from works;
wkdocre
-------------
+1654/12/31
+1706/12/31
+1667/12/31
-0332/12/31
-0332/12/31
-1295/12/31
我想将这些日期插入到另一个表中,该表的属性是这样的日期
update ns_works set wor_workcreationdate=(select wkdocre from works where wor_workcreationdate=wkdocre);
我收到此错误
ERROR: operator does not exist: ns_workcreationdate = dateofcreation
LINE 1: ...lect wkdocre from works where wor_workcreationdate=wkdocre);
^
HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts.
谢谢
期望的结果
select wor_creationdate from ns_works;
wor_creationdate
-------------
1654/12/31
1706/12/31
1667/12/31
-0332/12/31
-0332/12/31
-1295/12/31
【问题讨论】:
-
编辑您的问题并显示所需的结果。如果你想“插入”一些东西,你为什么要使用
update?
标签: sql postgresql date varchar