Jean Jean - 1 year ago 109
SQL Question

Access array elements ANSI SQL

I'm using Drill to query MongoDB using ANSI SQL , I have a field that contains an array of values, I want to be able to access those elements to join them with other documents .

select name from table where = array.element;

but other than
which divides them into multiple lines, I can't access the array's elements.
Any help please ?

Answer Source

I added some sample data in mongodb


Working query from Drill:

select name from col4 where id=arr[0];


| name  |
| dev   |