By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
6 rows affected
| orderId | code | val |
|---|---|---|
| 1 | Code1 | abc |
| 2 | Code2 | def |
| 3 | Code1 | aaa |
| 3 | Code2 | bbb |
| 4 | Code10 | aaa |
| 4 | Code2 | bbb |
| OrderId | Code |
|---|---|
| 1 | Code1 |
| 2 | Code2 |
| 3 | Code2 |
| 4 | Code2 |
| OrderId | Code | Val |
|---|---|---|
| 1 | Code1 | abc |
| 2 | Code2 | def |
| 3 | Code2 | bbb |
| 4 | Code2 | bbb |
| OrderId | code |
|---|---|
| 1 | 1 |
| 2 | 2 |
| 3 | 2 |
| 4 | 10 |
| OrderId | Code | Val |
|---|---|---|
| 1 | Code1 | abc |
| 2 | Code2 | def |
| 3 | Code2 | bbb |
| 4 | Code10 | aaa |
| orderId | code | val |
|---|---|---|
| 1 | Code1 | abc |
| 2 | Code2 | def |
| 3 | Code2 | bbb |
| 4 | Code10 | aaa |