Move
Move the P3 values in register P1..P1+P3-1 over into registers P2..P2+P3-1.
An example
6 of the 178 statements we compiled against the sample database use Move. This is the one with the shortest program; the rows that use Move are highlighted.
SELECT album_id, count(*), sum(ms) FROM tracks GROUP BY album_id
| addr | opcode | p1 | p2 | p3 | p4 | p5 |
|---|---|---|---|---|---|---|
| 0 | Init | 0 | 39 | 0 | 0 | |
| 1 | Noop | 1 | 2 | 0 | 0 | |
| 2 | Integer | 0 | 2 | 0 | 0 | |
| 3 | Null | 0 | 5 | 5 | 0 | |
| 4 | Gosub | 4 | 35 | 0 | 0 | |
| 5 | OpenRead | 0 | 4 | 0 | 4 | 0 |
| 6 | OpenRead | 2 | 5 | 0 | k(2,,) | 0 |
| 7 | Rewind | 2 | 23 | 7 | 0 | 0 |
| 8 | DeferredSeek | 2 | 0 | 0 | 0 | |
| 9 | Column | 2 | 0 | 6 | 0 | |
| 10 | Compare | 5 | 6 | 1 | k(1,B) | 0 |
| 11 | Jump | 12 | 16 | 12 | 0 | |
| 12 | Gosub | 3 | 27 | 0 | 0 | |
| 13 | Move | 6 | 5 | 1 | 0 | |
| 14 | IfPos | 2 | 38 | 0 | 0 | |
| 15 | Gosub | 4 | 35 | 0 | 0 | |
| 16 | AggStep | 0 | 0 | 9 | count(0) | 0 |
| 17 | Column | 0 | 3 | 11 | 0 | |
| 18 | AggStep | 0 | 11 | 10 | sum(1) | 1 |
| 19 | If | 1 | 21 | 0 | 0 | |
| 20 | Column | 2 | 0 | 7 | 0 | |
| 21 | Integer | 1 | 1 | 0 | 0 | |
| 22 | Next | 2 | 8 | 0 | 1 | |
| 23 | Gosub | 3 | 27 | 0 | 0 | |
| 24 | Goto | 0 | 38 | 0 | 0 | |
| 25 | Integer | 1 | 2 | 0 | 0 | |
| 26 | Return | 3 | 0 | 0 | 0 | |
| 27 | IfPos | 1 | 29 | 0 | 0 | |
| 28 | Return | 3 | 0 | 0 | 0 | |
| 29 | AggFinal | 9 | 0 | 0 | count(0) | 0 |
| 30 | AggFinal | 10 | 1 | 0 | sum(1) | 0 |
| 31 | Copy | 7 | 12 | 0 | 0 | |
| 32 | Copy | 9 | 13 | 1 | 0 | |
| 33 | ResultRow | 12 | 3 | 0 | 0 | |
| 34 | Return | 3 | 0 | 0 | 0 | |
| 35 | Null | 0 | 7 | 10 | 0 | |
| 36 | Integer | 0 | 1 | 0 | 0 | |
| 37 | Return | 4 | 0 | 0 | 0 | |
| 38 | Halt | 0 | 0 | 0 | 0 | |
| 39 | Transaction | 0 | 0 | 1 | 0 | 1 |
| 40 | Null | 0 | 5 | 5 | 0 | |
| 41 | Goto | 0 | 1 | 0 | 0 |
Open it in the EXPLAIN visualizer →
Also in this program: AggFinal, AggStep, Column, Compare, Copy, DeferredSeek, Gosub, Goto, Halt, If, IfPos, Init, Integer, Jump, Next, Noop, Null, OpenRead, ResultRow, Return, Rewind, Transaction.
What the SQLite documentation says
Move the P3 values in register P1..P1+P3-1 over into registers P2..P2+P3-1. Registers P1..P1+P3-1 are left holding a NULL. It is an error for register ranges P1..P1+P3-1 and P2..P2+P3-1 to overlap. It is an error for P3 to be less than 1.
From sqlite.org's list of opcodes for SQLite 3.54.1, in the public domain. Opcodes are not a stable interface and change between releases.