简体   繁体   中英

Represent Query Results as new Table

I have difficulty to construct right query currently i have two Queries

Query 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]

Query 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]

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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