[問題] insert語法一直出現問題

看板Database作者 (Effort)時間13年前 (2012/07/17 10:01), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/2 (看更多)
dao.query("insert into SubscribeNodeHeartbeat (hostname, subscriber_no,\ interval, event_callback) select '%s', subscriber_no, '%s', '%s' from \ Subscribers where subscriber_name = '%s' AND ipv4 = '%s' AND port = '%s';" \ %(hostname, interval, event_callback, subscriber_name, ipv4, port)) 我已經被這一行看似普通,卻一直insert不進去的窘境困擾很久。 他一直回我說syntax error,但我真的看不出來... 內容如下 (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'interval, event_callback) values ('TP1AA0101', 1, 3, '/Event')' at line 1") 想請問各位,我哪個有寫錯了? 拜託了。 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 60.250.129.63
文章代碼(AID): #1G1CTgo4 (Database)
文章代碼(AID): #1G1CTgo4 (Database)