SQL2 Query for case-insensitive
Hi,
I want to write a query in SQL2 to search through content fragments under /content/dam/testProject/content-fragments/en_us which is created using a specific template. In this query I also need to make sure that a property, myProperty contains a string "test". I have to make sure that the search is case-insensitive. I wrote the following query:
SELECT * FROM [dam:Asset] AS asset WHERE ISDESCENDANTNODE(asset, '/content/dam/testProject/content-fragments/en_us') AND asset.[jcr:content/data/master/isFeatured] = true AND LOWER(asset.[jcr:content/data/master/myProperty]) = 'test' ORDER BY [jcr:score] DESC
This is not working as expected. I also tried the following:
SELECT * FROM [dam:Asset] AS asset WHERE ISDESCENDANTNODE(asset, '/content/dam/testProject/content-fragments/en_us') AND asset.[jcr:content/data/master/isFeatured] = true AND CONTAINS(asset.[jcr:content/data/master/myProperty], 'test') ORDER BY [jcr:score] DESC
This does not work either.
Please note, that I am not getting any syntactical error. Just that I dont get the results as expected.
Could you please help me in writing a more targeted query for the requirement?
Thanks in advance!