yii2 sql 如何搜索id为偶数的结果?
Having了解下
select * from deepcate where mod(id,2)=0;//获取偶数 select * from deepcate where mod(id,2)=1;//获取奇数
select *
SELECT * FROM table WHERE id%2=0 SELECT * FROM table WHERE id%2=1 SELECT * FROM th_article WHERE POWER(-1,id)=1 SELECT * FROM th_article WHERE POWER(-1,id)=-1