-1
SQLクエリ:例えば、テーブルを更新しようとしているSQL:更新ピボットテーブル
SELECT id,mti,[24] AS nii,mid,tid,[63-D9] AS TxnType,[63-DB] AS batchStatus ,
[39] AS respondCode,[61] AS batchNumber, uploadStatus
FROM (SELECT e.id,m.capDateTime,mti,procCode,mid,tid,uploadStatus,txnDate,txnTime,fieldNumber,fieldData FROM dbo.iso_fields e
JOIN dbo.iso_main m ON e.id = m.id) a PIVOT (MAX(fieldData) FOR fieldNumber IN
([0],[1],[2],[3],[5],[6],[7],[8],[9],[10],[12],[13],[14],[15],[16],[17],[18],[19],[20], [21],[22],[23],[24],[25],[26],[27],[28],[29],[30],
[31],[32],[33],[34],[35],[36],[39],[40], [41],[42],[43],[44],[45],[46],[47],[48],[49],[50],[51],[52],[53],[54],[55],[56],[57],[58],[59],[60],
[61],[63],[64],[63-D9],[63-DB]))PIV
イム:
UPDATE PIV SET batchStatus = 'C'
SELECT id,mti,[24] AS nii,mid,tid,[63-D9] AS TxnType,[63-DB] AS batchStatus ,
[39] AS respondCode,[61] AS batchNumber, uploadStatus
FROM (SELECT e.id,m.capDateTime,mti,procCode,mid,tid,uploadStatus,txnDate,txnTime,fieldNumber,fieldData FROM dbo.iso_fields e
JOIN dbo.iso_main m ON e.id = m.id) a PIVOT (MAX(fieldData) FOR fieldNumber IN
([0],[1],[2],[3],[5],[6],[7],[8],[9],[10],[12],[13],[14],[15],[16],[17],[18],[19],[20], [21],[22],[23],[24],[25],[26],[27],[28],[29],[30],
[31],[32],[33],[34],[35],[36],[39],[40], [41],[42],[43],[44],[45],[46],[47],[48],[49],[50],[51],[52],[53],[54],[55],[56],[57],[58],[59],[60],
[61],[63],[64],[63-D9],[63-DB]))PIV
WHERE nii = '0000'
イムそれは、ピボットテーブルの中にとても恐ろしい正しい構文とイムではないかなり確信
どのDBMSを使用していますか? 「SQL」は特定のDBMS製品の名前ではなく、クエリ言語です(プラス:サンプルクエリは無効な標準SQLです) –