SQLTeam.com | Weblogs | Forums

Select statment in one alias column


#1

How can I can combine 2 queries in one and get the result under one column
Query 1 and Query 2
Select Employee 'A' as FC from Employee
Select Employee 'C as FC from Employee
thank you very much
I want Output to be like this
Employee FC
1 A
2 A
3 A
1 C
2 C
3 C


#2

Use "union all"


#3
Select Employee, FC
from Employee
cross join (
    select 'A' as FC
    union all
    select 'C'
) as cj1

#4

Ok... I'm curious. What is the purpose of this query? As written, it makes no practical sense.


#5

hi

also possible with

UNPIVOT

just something different .. as a solution
:slight_smile:
:slight_smile: