What is the difference between IN and EXISTS?

Hello

What is the difference between IN and EXISTS?

Thanks!

3 Likes

Still not understood, is there an one-sentence explanation?
I also would like to know what does IN (SELECT * FROM A) does, does it check across all the columns?

SQL Server does not support multi-column IN() expressions, so IN(SELECT * FROM myTable) will generate an error if myTable has more than one column.

Still not understood, is there an one-sentence explanation?

No, there isn't. I'm presuming you didn't read the article, since there are examples explaining the difference, but you don't reference it at all. Telling us that you don't understand in one sentence doesn't help us, we need to know specifically what you're struggling with.

Personally I'm struggling to understand if you actually want help from us or not. None of us are paid to help you, and you've demonstrated an extreme unwillingness to do the most basic research on your questions, and none at all in working with the answers provided. We're putting more time and effort into understanding your questions than you are.

Why should we continue if you won't?

3 Likes

Your One Sentence Explanation

I personally prefer 1 word or 2 word explanations .. much better in my opinon

IN ... check all values .. regardless of condition met
EXISTS ... check all values but as soon as one value meets condition EXIT

Read the documentation

hi

please see if this helps ..

Excellent, thank you. All I could ever need about this question.