Interbase-合并查询

问题描述 投票:0回答:1

我有一个表,其中有to列:QuestionAnswer。我想要一个查询,该查询导致一列可互换地包含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命令?

谢谢。

interbase combine
1个回答
0
投票

您要从子查询中选择什么?该选择从子查询结果中查找“ Question_Answer_Result”列;不存在这样的列。唯一的列是“问题”。

© www.soinside.com 2019 - 2024. All rights reserved.