我有一个表,其中有to列:Question
和Answer
。我想要一个查询,该查询导致一列可互换地包含Question
及其各自的Answer
。
示例:
表“ Question_Answer”
Q1, A1
Q2, A2
Q3, A3
Q4, A4
查询输出,列名“ Question_Answer_Result”
Q1
A1
Q2
A2
Q3
A3
Q4
A4
我尝试了以下命令:
select "Question_Answer_Result"
from (select "Question_Answer"."Question"
from "Question_Answer"
union all
select "Question_Answer"."Answer"
from "Question_Answer"
)
但是我收到消息“命令意外结束”。
什么是正确的SQL命令?
谢谢。
您要从子查询中选择什么?该选择从子查询结果中查找“ Question_Answer_Result”列;不存在这样的列。唯一的列是“问题”。