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
Post a Comment