0

I have Enum column with 2 values in it.Yes and No, Col('Yes','No')

Now I have a one functionality where in I have use this column and pull rows with both yes and no values,

Now when I do something like col = ('Yes' OR 'No')

I dont get any records, how do I pull all rows from that has all values of enum column.I need rows that has both yes and no values.

This column is part of one of my large query so refactoring the column from enum to varchar does solve the problem ? But I am curious to know as how to select all values for enum? I tried many ways,but I always null results.

3
  • If you want all of them, do not include col in the WHERE clause at all. It won't be filtered. Commented Feb 2, 2013 at 3:11
  • 1
    But anway, the correct syntax would be col = 'Yes' OR col = 'No' or using IN() as col IN('Yes', 'No') Commented Feb 2, 2013 at 3:11
  • ah Michael,You made my day.Thanks a lot.I never thought of going via IN.I will explore that.thanks Commented Feb 2, 2013 at 3:13

1 Answer 1

1

Use IN.

SELECT blah blah blah FROM blah WHERE col IN ('Yes','No')
Sign up to request clarification or add additional context in comments.

1 Comment

I will use IN Kolink.Thanks

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.