Without using for loop how to check whether an element of an array starts
with particular string in postgresql
In my postgresql query im using a for loop to check whether an element of
an array starts with particular string. If it starts with that particular
string then my query will display the index of that element.
Eg :
FOR i in 1..array_length(array[childrens],2) LOOP -- childrens is the array
IF position('SP' in childrens[i]) != 0 THEN
......
In this loop im checking element by element which is time consuming. So
please can anyone suggest me some idea to do this task and reduce the time
taken.
No comments:
Post a Comment