简体   繁体   English

将查询结果表示为新表

[英]Represent Query Results as new Table

I have difficulty to construct right query currently i have two Queries 我目前很难构造正确的查询,但我有两个查询

Query 1. 查询1。

SELECT $TOTAL
LET $CORE = (SELECT FROM SOMETHING_1 WHERE SOMECONDITION_1),
$SOURCE= (SELECT FROM SOMETHING_2 WHERE SOMECONDITION_2),
$TOTAL = UNIONALL($CORE.A , $CORE.B ,$SOURCE.C)

As A Result i receive: [A1, A2 , B1 , B2 ,C1 , C2] 结果,我收到: [A1,A2,B1,B2,C1,C2]

Query 2. 查询2。

SELECT $CORE.A , $CORE.B ,$SOURCE.C
LET $CORE = (SELECT FROM SOMETHING_1 WHERE SOMECONDITION_1),
$SOURCE= (SELECT FROM SOMETHING_2 WHERE SOMECONDITION_2)

As A Result i receive 结果我收到了

**[A1, A2 ],[ B1 , B2] ,[C1 , C2]**

Which query should i need two use if i want to receive following result: 如果我想收到以下结果,应该使用哪个查询:

[A1, B1 , C1 ],[ A2 , B2 , C2] [A1,B1,C1],[A2,B2,C2]

Thanks in advance 提前致谢

Try this: 尝试这个:

select expand($c)
LET $a = (select creationTime, modificationTime from SOMETHING_1 where SOMECONDITION_1),
$b = (select columns_mail from SOMETHING_2 where SOMECONDITION_2),
$c = unionall($a,$b)

this is what I get: 这就是我得到的:

在此处输入图片说明

Hope it helps 希望能帮助到你

Regards 问候

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM