如何显示以下结果 [英] How Do I Display The Following Result
本文介绍了如何显示以下结果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
这是我的2栏专栏::
A B
5 P
6 Q
7 R
8。
编写查询以使用CTE在单个列中显示以下列
输出为:
结果
6
7
8
P
Q
R
。
这将是很好的帮助如果我得到它。我使用 union all 来显示输出......但我想知道使用CTE。
感谢您帮助我获得所需的输出。
This is my Table with 2 columns::
A B
5 P
6 Q
7 R
8 .
Write a query to display the following columns in a single column using CTE
Output As:
Result
5
6
7
8
P
Q
R
.
It would be great help if i get it.Here i used union all to show the output...but i want to know using CTE.
Thank you for helping me to get the desired output.
推荐答案
完全没有意义,但在这里你是:
Totally pointless, but here you are:
With A as (
SELECT A result
FROM MYTable
)
,B as (
Select B Result
FROM MyTable
)
SELECT Result
FROM A
UNION
SELECT Result
FROM B
这篇关于如何显示以下结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文