我有2个表如下生成与SQL查询多个数据
Product_Asset:
PAId Tracks
1 2
2 3
Product_Asset_Resource:
Id PAId TrackNumber
1 1 1
2 1 2
3 2 1
4 2 2
5 2 3
我想知道我是否能够产生product_asset_resource
表中的数据基于product_asset
表使用TSQL查询(不复杂的光标等)
例如,如果轨道的在product_asset
数目是3,然后我需要与轨道号来填充3行中product_asset_resource
1,2,3-
你需要有一个数字表(或使用虚拟理货表)。只需加入数字<=曲目 –