Re: Fetch array elements

Andreas Säger <[email protected]> Mon, 14 Dec 2015 19:13:35 +0100
Newsgroups gmane.comp.java.hsqldb.user
Message-ID <[email protected]>
Am 14.12.2015 um 15:18 schrieb Fred Toussi:
> You can access elements of any array with the normal syntax
> select REGEXP_SUBSTRING_ARRAY( IP', '\d+')[1] ...
> 
> You may be able to use a WITH subquery to populate the array only once.
> WITH SELECT IP, REGEXP_SUBSTRING_ARRAY( IP', '\d+') FROM IP_LOG AS
> IPVALS(IP, IPARRAY)
> SELECT IPARRAY[1], IPARRAY[2], CARDINALITY(IPARRAY) ... FROM IPVALS
>  


Thank you very much. I assumed [0] based arrays all the time and never
understood what WITH can do in SQL.


------------------------------------------------------------------------------