Hi,
I am trying to use the LET clause to stock some information in an sub-query, keep the information relative to the record. After another select from the query where I save the variable, the variable holds the value only of the last record.
For example, a query over the GratefulDeadConcerts:
select *,$u from (select from (select expand(both()) from #9:8 limit 10) let $u = $current.performances)
This results in:
@rid | @version | @class | performances | song_type | name | type | out_followed_by | out_written_by | out_sung_by | in_followed_by | $u |
---|
#9:1 | 25 | V | 5 | cover | HEY BO DIDDLEY | song | [5] | [1] | [1] | [4] | 65 |
#9:4 | 265 | V | 394 | original | BERTHA | song | [53] | [1] | [1] | [76] | 65 |
#9:5 | 177 | V | 293 | cover | GOING DOWN THE ROAD FEELING BAD | song | [39] | [1] | [1] | [46] | 65 |
#9:12 | 167 | V | 312 | original | CASEY JONES | song | [47] | [1] | [1] | [33] | 65 |
#9:13 | 297 | V | 423 | original | DEAL | song | [80] | [1] | [1] | [65] | 65 |
#9:17 | 161 | V | 328 | original | STELLA BLUE | song | [31] | [1] | [1] | [46] | 65 |
#9:21 | 237 | V | 241 | cover | COLD RAIN AND SNOW | song | [56] | [1] | [1] | [59] | 65 |
#9:22 | 225 | V | 332 | original | UNCLE JOHNS BAND | song | [49] | [1] | [1] | [60] | 65 |
#9:28 | 35 | V | 234 | original | MISSISSIPPI HALF-STEP | song | [7] | [1] | [1] | [7] | 65 |
#9:29 | 139 | V | 65 | original | HERE COMES SUNSHINE | song | [34] | [1] | [1] | [32] | 65 |
The value of $u will always be 65 cause the last record has the performances value of 65. Why is this happening ?
I am running OrientDB v1.7.4. Hope someone can help me understand what is happening. If it is a bug of some sort, how can I go around it, and get my output ?