saffar4ever
asked on
How to use more than one percentage sign in queries in OrientDB?
How to use more than one percentage sign in queries in OrientDB?
For example : select from MyNode where MyNodeText.toLowerCase() like '%text1%text2%'
This does not work
For example : select from MyNode where MyNodeText.toLowerCase() like '%text1%text2%'
This does not work
ASKER
Hi,
I am trying to find values that contain text1 followed by text2. any character before text1 and after text 2 is allowed and any character between them is allowed.
I am trying to find values that contain text1 followed by text2. any character before text1 and after text 2 is allowed and any character between them is allowed.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
>> any character before text1 and after text 2 is allowed and any character between them is allowed. <<
Are you saying any single character is allowed in those locations or any group of characters? Can you provide some sample data and what you expect for results (include an example where '%text1%text2%' doesn't work).
Are you saying any single character is allowed in those locations or any group of characters? Can you provide some sample data and what you expect for results (include an example where '%text1%text2%' doesn't work).
ASKER
@awking00
@NerdsOfTech
Thank you NerdsOfTech. Regular expressions worked for me.
Are you saying any single character is allowed in those locations or any group of characters?I mean any group of characters
Can you provide some sample data and what you expect for results (include an example where '%text1%text2%' doesn't work).Suppose the data is 'all the time'. If I search '%all%time%', the OrientDB returns nothing. I'm guessing it is a syntax problem.
@NerdsOfTech
Thank you NerdsOfTech. Regular expressions worked for me.
Are you looking for a string containing % or trying to create a complex regular expression with multiple %.
The first will likely be easy. Most SQL variants support %% to escape the % character.
The second will work exactly as you have it written, at least for most SQL variants.
Docs for your version of OrientDB will provide correct answers to your questions.