Ne
This works just like the Eq opcode except that the jump is taken if the operands in registers P1 and P3 are not equal.
Jumps: P2 is an instruction address. In the listings here, a jump is drawn as an arc and the address is a link.
An example
28 of the 178 statements we compiled against the sample database use Ne. This is the one with the shortest program; the rows that use Ne are highlighted.
DROP VIEW album_lengths
| addr | opcode | p1 | p2 | p3 | p4 | p5 |
|---|---|---|---|---|---|---|
| 0 | Init | 0 | 14 | 0 | 0 | |
| 1 | Null | 0 | 1 | 0 | 0 | |
| 2 | OpenWrite | 0 | 1 | 0 | 5 | 0 |
| 3 | Rewind | 0 | 11 | 0 | 0 | |
| 4 | Column | 0 | 2 | 2 | 0 | |
| 5 | Ne | 3 | 10 | 2 | BINARY-8 | 82 |
| 6 | Column | 0 | 0 | 2 | 0 | |
| 7 | Eq | 4 | 10 | 2 | BINARY-8 | 82 |
| 8 | Rowid | 0 | 5 | 0 | 0 | |
| 9 | Delete | 0 | 0 | 0 | 2 | |
| 10 | Next | 0 | 4 | 0 | 1 | |
| 11 | DropTable | 0 | 0 | 0 | album_lengths | 0 |
| 12 | SetCookie | 0 | 1 | 2 | 0 | |
| 13 | Halt | 0 | 0 | 0 | 0 | |
| 14 | Transaction | 0 | 1 | 1 | 0 | 1 |
| 15 | String8 | 0 | 3 | 0 | album_lengths | 0 |
| 16 | String8 | 0 | 4 | 0 | trigger | 0 |
| 17 | Goto | 0 | 1 | 0 | 0 |
Open it in the EXPLAIN visualizer →
Also in this program: Column, Delete, DropTable, Eq, Goto, Halt, Init, Next, Null, OpenWrite, Rewind, Rowid, SetCookie, String8, Transaction.
What the SQLite documentation says
This works just like the Eq opcode except that the jump is taken if the operands in registers P1 and P3 are not equal. See the Eq opcode for additional information.
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.