INNER JOIN 在 Sqlite 中无效 android
INNER JOIN not working form in Sqlite android
我们有两个 table (toRouteCSV7,UpdateFOCQtyTable)
.toRouteCSV7 有两列。 ItemNumber and FOCQty
和 UpdateFOCQtyTable 有两列 ItemID,updatefocvalue
toRouteCSV7
in
ItemNumber FOCQty
A123 0
A124 0
A125 0
A126 0
更新FOCQtyTable
ItemID updatefocvalue
A125 1256
A126 14596
更新后我们需要看起来像这样
ItemNumber FOCQty
A123 0
A124 0
A125 1256
A126 14596
我们这样试过
tx.executeSql('REPLACE INTO toRouteCSV7 (ItemNumber,FOCQty) select dest.ItemNumber,dest.FOCQty,src.ItemID,src.updatefocvalue from UpdateFOCQtyTable src inner join toRouteCSV7 dest on src.ItemID = dest.ItemNumber');
我们没有任何 luck.We 正在使用 phoneGap.Please 开发移动应用程序的指南给我们
我们遇到错误
Error Processing SQL:5
Error Processing message SQL:could not prepare statement(1 4 values for 2 columns)
只要你想更新单个列,你可以简单地使用相关子查询:
UPDATE toRouteCSV7
SET FOCQty = (SELECT updatefocvalue
FROM UpdateFOCQtyTable
WHERE ItemID = toRouteCSV7.ItemNumber)
WHERE ItemNumber IN (SELECT ItemID
FROM UpdateFOCQtyTable)
我们有两个 table (toRouteCSV7,UpdateFOCQtyTable)
.toRouteCSV7 有两列。 ItemNumber and FOCQty
和 UpdateFOCQtyTable 有两列 ItemID,updatefocvalue
toRouteCSV7
in
ItemNumber FOCQty
A123 0
A124 0
A125 0
A126 0
更新FOCQtyTable
ItemID updatefocvalue
A125 1256
A126 14596
更新后我们需要看起来像这样
ItemNumber FOCQty
A123 0
A124 0
A125 1256
A126 14596
我们这样试过
tx.executeSql('REPLACE INTO toRouteCSV7 (ItemNumber,FOCQty) select dest.ItemNumber,dest.FOCQty,src.ItemID,src.updatefocvalue from UpdateFOCQtyTable src inner join toRouteCSV7 dest on src.ItemID = dest.ItemNumber');
我们没有任何 luck.We 正在使用 phoneGap.Please 开发移动应用程序的指南给我们
我们遇到错误
Error Processing SQL:5
Error Processing message SQL:could not prepare statement(1 4 values for 2 columns)
只要你想更新单个列,你可以简单地使用相关子查询:
UPDATE toRouteCSV7
SET FOCQty = (SELECT updatefocvalue
FROM UpdateFOCQtyTable
WHERE ItemID = toRouteCSV7.ItemNumber)
WHERE ItemNumber IN (SELECT ItemID
FROM UpdateFOCQtyTable)