Thanks geraldss, but I have no order criteria for this.
Can you tell me if there’s an ORDER BY clause that let me order a result set depending on elements in an array?
Example: order by id in [“id1”, “id2”]
Is the above query supposed to order by the lexicographic order of the ids? Because I want to order the output by the position of the id in the array.
For example, If I have the following array of keys = [“c”, “a”]
I want the output [“obj with key = c”, “obj with key = a”]
And not the set sorted by id
I am using this query to do order on basis of an array [ ];
select raw t.unique_id from Test t where meta(t).id=“order_array”;
Now, using this above query in below (order by array_position())
FROM Test AS s
let ordered=(select raw t.unique_id from Test t where meta(t).id=“order_array”)
order by array_position(ordered,s.physicalIndex);
But here I am not getting the ordered output as expected on basis of array position.
As per requirement, I can not hardcoded the array here.