Search code examples
sqlsql-servert-sqlmultiplication

Multiple rows in table with values from another table


I am struggling with following issue:

Table1:

enter image description here

Table2:

enter image description here

Expected result:

enter image description here

Basically I want to multiple rows in dates table with rows from User table. Is it somehow possible? (using TSQL).


Solution

  • You need to apply cross join

    select date,month,userid,userno from table1 cross join table2