嘿,我在尝试更新数据库中的表时遇到此错误:
每个派生表都必须有自己的别名
这是我试图更新的mysql查询:
UPDATE (SELECT clientinfo.idNumber, clientinfo.theCompName, clientoffers.idNumber,
clientoffers.expTimeWaiting, clientoffers.theDateStart,
clientoffers.theDateEnd, clientoffers.theOffer, clientoffers.isActive,
clientoffers.theType, clientoffers.fixedAmount, clientoffers.fixedUsed
FROM clientinfo, clientoffers
WHERE clientoffers.idNumber = clientinfo.idNumber
AND clientoffers.theDateEnd >= '2010-06-03'
AND clientoffers.theDateStart <= '2010-06-03'
AND clientoffers.idNumber = 'NB351560'
AND clientoffers.isActive = 'YES')
SET clientoffers.fixedUsed = clientoffers.fixedUsed + 1
这看起来不错,但由于某种原因似乎不起作用?
任何帮助都会很棒!:o)
更新
sqltemp = "UPDATE clientinfo, clientoffers SET clientoffers.fixedUsed = clientoffers.fixedUsed + 1 WHERE clientoffers.idNumber = clientinfo.idNumber" & _
"AND clientoffers.theDateEnd >= '2010-06-03'" & _
"AND clientoffers.theDateStart <= '2010-06-03'" & _
"AND clientoffers.idNumber = 'NB351560'" & _
"AND clientoffers.isActive = 'YES'"
oRecordset.Open sqltemp, oConnection,3,3
它给了我 ODBC 驱动程序不支持请求的属性的错误。
我正在使用带有经典 ASP 的 Mysql 5.1。
大卫