S
S
Smilley2019-05-04 18:58:09
SQL Server
Smilley, 2019-05-04 18:58:09

How to merge query result columns in MSSQL?

Good afternoon, please tell me how to write a query in MSSQL, which will combine the results of others. For example, I want the following three queries to appear in one line with columns a,b,c and, accordingly, the values ​​​​in them 1,2,3

select '1' as 'a'
select '2' as 'b'
select '3' as 'c'

In real life, the selects themselves, of course, will be more voluminous :)

Answer the question

In order to leave comments, you need to log in

2 answer(s)
K
Konstantin Tsvetkov, 2019-05-04
@Smilley

PIVOT .
PIVOT / Sudo Null IT News
Or you need:

SELECT (select '1') as [a], (select '2') as [b], (select '3') as [c]
?

R
res2001, 2019-05-04
@res2001

select '1' as 'a', '2' as 'b', '3' as 'c'

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question