想知道我下面这个数据库的语句为什么显示报错?

```sql

use teaching2021;
select id,idcard,if(substring(idcard,17,1)%2=1,'男','女')as'性别'
from identity

```)
题目要求根据身份证号来辨别性别

substring(idcard,17,1)是字符串切割,切割结果也是字符串,但是,%2是数值运算,类型不匹配。你可以改为

select id,idcard,if(substring(idcard,17,1) in('1','3','5','7','9'),'男''女') as '性别' 
from `teaching2021`.identity

里面的"use teaching2021;"也不需要了