python pandasql库操作 sql 语句,我在查询语句里用了求余 mod()函数
在 mysql 中运行没有报错,可以查询到
语句在 Python 中报错,提示我 sqlite3.OperationalError: no such function: mod
查询语句代码附下
select * from tables WHERE
mod((
substr(A5,1,1)*7+
substr(A5,2,1)*9+
substr(A5,3,1)*10+
substr(A5,4,1)*5+
substr(A5,5,1)*8+
substr(A5,6,1)*4+
substr(A5,7,1)*2+
substr(A5,8,1)*1+
substr(A5,9,1)*6+
substr(A5,10,1)*3+
substr(A5,11,1)*7+
substr(A5,12,1)*9+
substr(A5,13,1)*10+
substr(A5,14,1)*5+
substr(A5,15,1)*8+
substr(A5,16,1)*4+
substr(A5,17,1)*2
),11)
<>
(
case
when substr(A5,18,1)='1' then '0'
when substr(A5,18,1)='0' then '1'
when substr(A5,18,1) in ('X','x') then '2'
when substr(A5,18,1)='9' then '3'
when substr(A5,18,1)='8' then '4'
when substr(A5,18,1)='7' then '5'
when substr(A5,18,1)='6' then '6'
when substr(A5,18,1)='5' then '7'
when substr(A5,18,1)='4' then '8'
when substr(A5,18,1)='3' then '9'
when substr(A5,18,1)='2' then '10'
end
)