Two columns entire results into single columns

Raj0125 511 Reputation points
2022-06-30T12:02:33.25+00:00

Hi ,

select
Class2_Code_Source,
SubClass2_Code_Source,
Product_SubClass2_Name_Source,
c.Product_SubClass1_SKey,
s.Product_SubClass1_SKey

from SubClass2_Source s
Inner join SubClass1 c on s.Product_SubClass1_SKey=c.Product_SubClass1_SKey

I want 2 Product_SubClass1_SKey from 2 different tables in to single column.How can i achive this

Azure SQL Database
0 comments No comments
{count} vote

Accepted answer
  1. Alberto Morillo 34,461 Reputation points MVP
    2022-06-30T12:13:13.933+00:00

    SELECT t.Product_SubClass1_SKey
    FROM
    (
    SELECT c.Product_SubClass1_SKey
    FROM SubClass1 c
    UNION
    SELECT s.Product_SubClass1_SKey
    from SubClass2_Source s
    ) t


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.