Greendao - 如何比较字符串列忽略大小写? [英] Greendao - How to compare string column ignoring case?
本文介绍了Greendao - 如何比较字符串列忽略大小写?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在 sqlite 中有一个查询:
I have a query in sqlite:
select * from table where upper(name) = "ABC";
greendao 中是否有执行相同查询的函数?
Is there a function in greendao to execute same query?
推荐答案
您可以使用 LIKE.例如:
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"
上面三个例子在sqlite中的结果是一样的(mysql也是,我不知道是不是所有的DB都一样).然后你可以使用 GreenDao 的等价物:
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))
这篇关于Greendao - 如何比较字符串列忽略大小写?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文