mysql中当if在where中的条件中出现时格式为:
select * from student where if (sex=0,age>10,age>12)
当if出现在查询语句中作为查询结果出现格式为:
select name,if(sex=0,'女','男') as sex from student;
mysql中当if在where中的条件中出现时格式为:
select * from student where if (sex=0,age>10,age>12)
当if出现在查询语句中作为查询结果出现格式为:
select name,if(sex=0,'女','男') as sex from student;