Reputation: 31
I have 2 tables
Plant config
------ --------
TRZ1 KS
MAS1 MT
I would like to have below table with 2 columns
RESULT
------
TRZ1 KS
TRZ1 MT
MAS1 KS
MAS1 MT
Thanks for the help
Upvotes: 0
Views: 420
Reputation: 546
Use can use CROSS JOIN:
SELECT P.NAME, C.NAME FROM Plant AS P CROSS JOIN Config AS C
Upvotes: 0
Reputation: 247640
It is not clear if you want this in the same column, if so then you can concatenate the values using:
select p.col1 + ' ' + c.col1 as result
from plant p
outer apply config c
If not, then you can use:
select p.col1 plant, c.col1 config
from plant p
outer apply config c
Upvotes: 2