I want to select lines containing one of the strings specified by the vector keyWords in the “index_name“ column. The items of keyWords are not fixed. The following is my script:
keyWords = ['Charging pile','Charging']
tbIndexBasicInfoDemo = select * from tbIndex where or (like(index_name, stringFormat("%i%",keyWords[0])),like(index_name, stringFormat("%i%",keyWords[1])))
However, an error occurs: stringFormat(format, [args...]). : invalid format for %. How to modify my script?
You can concatenate strings with placeholders as follows: