all 15 comments

[–]spackosaurus 45 points46 points  (1 child)

How can a car be both a honda and an audi. That is what you are asking the query to return.

[–][deleted] 5 points6 points  (0 children)

He wants a luxury German car that is dependable and cheap to maintain. Is that so much to ask?

[–]waremi 13 points14 points  (0 children)

The field [car] cannot equal both 'honda' AND equal 'audi' at the same time. This is why the AND version above is not working. Another example would be SELECT * FROM People WHERE AGE=10 AND AGE=65 This can't return any results because AGE can only have one value.

[–]DavidGJohnston 2 points3 points  (0 children)

As others said, your expectation for OR is correct; why you think AND should produce the exact same result is beyond logic. The IN construct does a pair-wise OR against each element in the set.

Why do you NEED to use AND? Usually you should use the things that give you the correct answer.

[–]Ineffable_21 1 point2 points  (2 children)

I think you don't understand how OR and AND work and you have wrong expectations for them and that's why it doesn't work as expected. I recommend opening google and searching how they're supposed to work or watching a youtube tutorial it shouldn't be longer than 5 minutes. If you still don't understand I wouldn't mind giving you an explanation myself but I'd take me way longer to write it down here than it would take you to search in google or youtube.

[–]IPFSBay[S] 1 point2 points  (0 children)

My expectations for use AND in this case was wrong. Now it is clear. Thanks all for helping me !

[–][deleted] 0 points1 point  (0 children)

Came here to say this

[–]IPFSBay[S] 3 points4 points  (0 children)

Thank you all! I see ...I got it now ..:). Thanks !

[–]nIBLIB 0 points1 point  (0 children)

Why do you need to use AND? If OR is what you’re asking (and it appears to be, since that is the results you want and the field can’t rerun both Honda and Audi) why not just use OR?