I'm trying to execute the following sql query on postgres:
INSERT INTO Works_On (ESSN,PNo,Hours) VALUES ('199112111',3,3)
ON DUPLICATE KEY UPDATE Hours = 3;
But when I do I get an error which follows:
psql:test2.sql:2: ERROR: syntax error at or near "ON"
LINE 2: ON DUPLICATE KEY UPDATE Hours = 3;
^
I can't really find the error, help would be most appreciated!
psqlit's looks like you are using postgresql. Added the same tag. Moreover there is noON DUPLICATE KEY UPDATEin postgresql. See this related post which may be of your help stackoverflow.com/questions/1109061/…