Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Can we have a Table like this with blank rows ??
| User_id | Region_ Id | Sub_User_id | Plan_id |
| 1 | 1 | ||
| 2 | 2 | ||
| 3 | 3 | ||
| 4 | 1 | ||
| 4 | 2 | ||
| 5 | 3 | ||
| 5 | 4 | ||
| 6 | 5 | ||
| 6 | 6 | ||
| 7 | 7 | ||
| 7 | 8 | ||
| 8 | 9 | ||
| 8 | 10 | ||
| 9 | 11 | ||
| 9 | 12 |
| User_id | Sub_User_id |
| 1 | 4 |
| 1 | 5 |
| 2 | 6 |
| 2 | 7 |
| 3 | 8 |
| 3 | 9 |
Well, if you join the two tables (User_id + Region_id and Sub_User_id + Plan_id) you'll create a carthesian product, i.e. every combination of the two tables which seems to be what you're looking for in the resulting table. Be prepared for a lot of combinations if you have more data though when joining tables without any common fields. 1000 rows times 1000 rows quickly becomes one million combinations etc.