Given this table:
CREATE TABLE datasets.travel(path integer[], path_timediff double precision[]);
INSERT INTO datasets.travel
VALUES (array[50,49,49,49,49,50], array[NULL,438,12,496,17,435]);
I am looking for some kind of function or query in the PostgreSQL that for a given input array[49,50] will find the matching consecutive index values in path which is [5,6] and the corresponding element in path_timediff which is 435 in the example (array index 6).
My ultimate purpose is to find all such occurrences of [49,50] in path and all the corresponding elements in path_timediff. How can I do that?
array1[50,49,49,49,49.50]is invalid. Can you clarify your example, please? And show your version of Postgres and the indexes you have.the index values in array1 which is [4,5].. looks like this should read[5,6]? Or explain how you match exactly ... (Also, yourINSERTsyntax is invalid as well.)