Reputation: 319
For example I have following table
[id, V1, V2]
[A , 1 , 5]
[A , 2 , 4]
[A , 3 , 3]
[A , 4 , 2]
[B , 9 , 6]
[B , 8 , 7]
[B , 7 , 8]
[B , 6 , 9]
I Want to create query with following result
[id, V1` , V2` ] ]
[A , [1,2,3,4] , [5,4,3,2] ]
[B , [9,8,7,6] , [6,7,8,9] ]
OR
[id, min , max ]
[A , [1] , [5] ]
[B , [6] , [9] ]
How this query can be costructed ? I allready tried a lot of options but failed.
Any help will be appriciated. Thanks in advance
Upvotes: 0
Views: 42
Reputation: 2632
Try this:
select id, $a.V1 as V1, $a.V2 as V2 from <class name>
let $a = (select from <class name> where $parent.current.id = id)
group by id
Hope it helps
Regards
Upvotes: 1