关于Android room 时间函数条件的坑 给需要的人

    科技2025-07-22  5

    需要做一个按照年份查询的sql

    正确的 WHERE strftime('%Y', next_date) = :year

    坑1 '%Y' y区分大小写

    坑2  传参 year 只能是string 不能为int

     

    Processed: 0.011, SQL: 8