How to use the cursor to traverse the table when a certain condition is met to write to another table all the records above the cursor, in which the value in one field is repeated in order?
Suppose there is a similar label. In it, the fields are sorted by the field NOM_V
. As means of the C language and embedded SQL if the conditions coincide:
1) Some condition was fulfilled in the adjacent field (for example, it contains NULL
)
2) This is the last entry with a C
value in the NOM_V
field
arrange INSERT
to another table of all records containing the value of С
in NOM_VAG
. (in this case, the record [4,5,6]
).
upd. The case may not be unique. It is required to select records from the entire table where these conditions are the same. Those. if the condition in field1
fulfilled in record 9, then, in addition to [4,5,6]
, [7,8,9]
must also be hooked. And so on to the very end.
SCROLL
cursor? Probably, if it doesn't work out, I will solve the problem using an array. - LittleTofu