如何让这两个WHERE语句满意?
where("cast(strftime('%d', date) as int) = ?", month)
where("cast(strftime('%Y', date) as int) = ?", year)
类似的东西:
where("cast(strftime('%d', date) as int) = ?", month) AND
where("cast(strftime('%Y', date) as int) = ?", year)
我尝试了一些方法,但无法使其正常工作。
由于
答案 0 :(得分:1)
您可以使用多个问号:
where("cast(strftime('%d', date) as int) = ?
AND cast(strftime('%Y', date) as int) = ?", month, year)
或者只使用2个where
语句:
where("cast(strftime('%d', date) as int) = ?", month)
.where("cast(strftime('%Y', date) as int) = ?", year)