mysql if elseif syntax condition -


if have 2 parameter "parameterx" , "parametery"

and i'll using "parameterx" , "parametery" commend sql snytax

like as

select * test.test  if(parametery!=0)  test.test.'x'=parameterx , test.test.'y'=parametery  else if  test.test.'x'=parameterx  end if 

i know this's can't work want know have other way , can work in mysql

or easier (than @diehud's answer):

select * test.test  test.test.'x'=parameterx , (test.test.'y'=parametery or parametery=0) 

Comments

Popular posts from this blog

Django REST Framework perform_create: You cannot call `.save()` after accessing `serializer.data` -

Why does Go error when trying to marshal this JSON? -