我一直在尝试使用 Coldfusion MX 7 更新 MySQL 5.0 中的表。但查询仅更新/添加第一条记录,而不更新/添加其他 60,000 条记录。
<cfquery name="count" datasource="voyager">
SELECT
PATRON.PATRON_ID,
PATRON.HISTORICAL_CHARGES,
PATRON.HISTORICAL_BOOKINGS,
PATRON.HISTORICAL_DISTRIBUTIONS,
PATRON.HISTORICAL_SHORT_LOANS,
PATRON.HISTORICAL_CHARGES_UB,
PATRON.HISTORICAL_REQUESTS_UB
FROM PATRON
</cfquery>
<cfquery name="update" datasource="patrons">
<cfoutput>
REPLACE INTO patrondailyusecounttotals (PATRON_ID, HISTORICAL_CHARGES)
VALUES ('#count.PATRON_ID#', '#count.HISTORICAL_CHARGES#')
</cfoutput>
</cfquery>