我有两张桌子
Plant config
------ --------
TRZ1 KS
MAS1 MT我想要有2列的表格
RESULT
------
TRZ1 KS
TRZ1 MT
MAS1 KS
MAS1 MT谢谢你的帮助
发布于 2012-10-16 21:08:16
目前还不清楚您是否希望在同一列中包含这些值,如果是,则可以使用以下命令来连接这些值:
select p.col1 + ' ' + c.col1 as result
from plant p
outer apply config c请参阅SQL Fiddle with Demo
如果不是,那么您可以使用:
select p.col1 plant, c.col1 config
from plant p
outer apply config c请参阅SQL Fiddle with Demo
发布于 2012-10-16 21:06:09
最短路径:
select * from plant, config发布于 2012-10-16 22:06:23
Use可以使用CROSS JOIN:
选择工厂中的P.NAME、C.NAME作为P交叉连接配置为C
https://stackoverflow.com/questions/12915339
复制相似问题