嗨,我正在从以下逻辑制作MySQL语句.
Select * from content
if(description=='educational')
where serial like '%EDU2015%'
else where serial like '%NOVEL2015%'
Run Code Online (Sandbox Code Playgroud)
逻辑很简单,如果说明列是教育性的,那么过滤器应该有字符串"EDU2015.否则,它应该使用"NOVEL2015"的序列进行过滤
我不确定我是否使用在mysql中使用IF语句的方式,但我不知道在哪里放置来自https://dev.mysql.com/doc/refman/5.7/en/if.html的where语句