Skip to content
Advertisement

Combine 2 tables without primary key

I have 2 tables and wanna combine as below

Table Student:

Table Subject:

Combined:

I hope anyone can help. Thanks

Advertisement

Answer

In your case you need to use the SQL CROSS JOIN that produces a result set which is the number of rows in the first table multiplied by the number of rows in the second table (if no WHERE clause is used along with CROSS JOIN).This kind of result is called ‘Cartesian Product’.

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement