TmpTable1
Col1 = Category1
Col1 = Category2
TmpTable2
30 records for a month
我如何为每个类别显示30条记录,因此结果将显示60条记录
答案 0 :(得分:1)
您需要cross join
:
select t1.*, t2.category
from table1 t1 cross join
(select distinct category from table2) t2;
但是,如果您没有重复,那么您可以直接将其表达为:
select *
from table1 t1 cross join
table2 t2;