If the total amount is an odd number, how would you swap the id for each two consecutive records and leave the last one unswapped?
Use the records table and return one row per record. Preserve the original row count, and if there is an unpaired final record, keep its id unchanged.
id as the swapped id value for each rowvalue as the original row value| Column | Type | Description |
|---|---|---|
| idPK | INT | Unique record identifier |
| value | VARCHAR(100) | Associated record value |