Skip to content
Advertisement

Write Condition as a value for the where clause

I have a variable called _gender thats going to be either 0, 1 or 2

I want to achieve the case where _gender is everyone, then I want the gender to be 0 or 1

But if it was 0 or 1, then I should match with users that are only as the variable

Advertisement

Answer

You have to Denote Variable starting with @.

Lets consider variable @gender

If you want when @gender is everyone, then the gender to be 0 or 1.

If you want when @gender is everyone, then the all type of gender from your table.

For reference click below link Code Reference Link Click Here

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement