'Add missing rows within a table

I need a hint please, in my table it can happen that positions of an order is not written to the next ID.

Let's look at the table:

Pos 2 is missing in ID 3

ID DOC POSI TOTAL
1 123 1 100
1 123 2 600
1 123 3 200
2 123 1 100
2 123 2 600
2 123 3 200
3 123 1 100
3 123 3 200

Is it possible to create a view using SQL that compares the individual IDs partitions with each other and appends the missing value from ID 2 to ID 3 as a row?

Maybe you have some keywords for me, if something like this is possible.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source