# Query information stored in a link **Category:** [AQL](https://discourse.openehr.org/c/aql/43) **Created:** 2024-08-23 13:05 UTC **Views:** 68 **Replies:** 1 **URL:** https://discourse.openehr.org/t/query-information-stored-in-a-link/5611 --- ## Post #1 by @Cartwright Dear all, I want to retrieve the target item stored in a link. Using the following AQL query: `SELECT c/links FROM EHR e CONTAINS COMPOSITION c` I could output the list of links (containing one link only): ``` [ [ { "meaning": { "_type": "DV_TEXT", "value": "MeaningParent com.example.restservice.zib.compositions.burgerlijkestaatcomposition.BurgerlijkeStaatComposition" }, "target": { "value": "ehr://TargetParent" }, "type": { "_type": "DV_TEXT", "value": "TypeParent alcohol_gebruik" } } ] ] ``` I've tried to retrieve the first item of the list using `c/links[0]` with no successes. Is it something possible to achieve with AQL? Thanks for your help! --- ## Post #2 by @ian.mcnicoll Array-indexes are not supported AFAIK. Certainly dos not work on Better's CDR. You would have to do something like this ``` SELECT c/links as clinks FROM EHR e CONTAINS COMPOSITION c OFFSET 0 LIMIT 1 ``` or ``` SELECT TOP 1 c/links as clinks FROM EHR e CONTAINS COMPOSITION c ``` Though TOP is being deprecated It's possibly not a great idea to filter on array position though as my understanding is that the order of each row is essentially indeterminate, and you may not get back what you think of as the 'first row' --- **Canonical:** https://discourse.openehr.org/t/query-information-stored-in-a-link/5611 **Original content:** https://discourse.openehr.org/t/query-information-stored-in-a-link/5611