Skip to content Skip to sidebar Skip to footer

Greendao - How To Compare String Column Ignoring Case?

I have a query in sqlite: select * from table where upper(name) = 'ABC'; Is there a function in greendao to execute same query?

Solution 1:

You can use LIKE for that. For example:

SELECT*FROM prices WHERE flow LIKE "Tiroirs"
SELECT*FROM prices WHERE flow LIKE "TirOirS"
SELECT*FROM prices WHERE flow LIKE "tiroirS"

The three examples above have the same result in sqlite (mysql also, I don't know if all DBs have the same behaviour). Then you can use the equivalent for GreenDao :

priceDao.queryBuilder().where(PricesDBDao.Properties.Flow.like(flow))

Solution 2:

Try like this RAW Query

Query query = userDao.queryBuilder().where(
new StringCondition("(select * from table where upper(name) = "ABC")").build();

Post a Comment for "Greendao - How To Compare String Column Ignoring Case?"