Re: nth Occurence of String in Set
@Jerry : As said, I am neither the admin nor have I the privileges to
normalize the db. Furthermore normalizing this column would create
more overhead than performance gain could be won.
@tobi: After reconsidering my function and rereading substring_index
documentation I changed the function to
CREATE FUNCTION element_in_set(mystring varchar(4096),sep varchar(25),
myindex int(4))
RETURNS VARCHAR(4096) DETERMINISTIC
BEGIN
RETURN substring_index(substring_index(mystring,sep,myind ex),sep,-1);
END
So thanks for the hint. I nonetheless consider a "RTFM" and a oneliner
rather rude, unhelpful and a totally unnecessary personal attack.
Groups are for seeking and giving advice not for lecturing,
downtalking or slagging so. off
|