HOW TO USE EXISTS FUNCTION WITH 3 TABLES

  • Can you Please show me that how can we use EXISTS FUNCTION WITH 3 OR MORE TABLE. Please show me the code and explanation. Thx for your cooperation

  • Got data? (Create table scripts, insert scripts)

  • SELECT * FROM A
    WHERE
    EXISTS (SELECT * FROM B)
    AND
    EXISTS (SELECT * FROM C)

    Selects all rows from table A if there are rows in Table B and rows in Table C.
    Is this a usefull query? I do not think so. **)
    But it's an example. Using a WHERE clause for the tables B and C would probably make something like this more usefull.

    Ben

    **) The question is far to open, you do not specify where you come from or where you go too, or what the purpose is.
    It very similar to the question: Where can I drive too with my car?

  • ipervez784 - Monday, March 4, 2019 4:23 PM

    jcelko212 32090 - Monday, March 4, 2019 1:55 PM

    ipervez784 - Sunday, March 3, 2019 8:32 PM

    For over 35 years, the convention on SQL forums has been to post DDL along with clear specs. This is basic netiquette in our community and failure to follow it is considered rude. I always beat people for this failure because it's been posted on all these forums all these decades. This means you didn't bother to read the agreements and conventions. And as far as my mental health goes, I still have my Mensa membership πŸ˜€

    Please post DDL and follow ANSI/ISO standards when asking for help. 

  • jcelko212 32090 - Tuesday, March 5, 2019 9:30 AM

    ipervez784 - Monday, March 4, 2019 4:23 PM

    jcelko212 32090 - Monday, March 4, 2019 1:55 PM

    ipervez784 - Sunday, March 3, 2019 8:32 PM

    For over 35 years, the convention on SQL forums has been to post DDL along with clear specs. This is basic netiquette in our community and failure to follow it is considered rude. I always beat people for this failure because it's been posted on all these forums all these decades. This means you didn't bother to read the agreements and conventions. And as far as my mental health goes, I still have my Mensa membership πŸ˜€

    Frankly, Joe, I can't understand why anyone would be concerned about your mental health, as you are clearly a serious nut case, Mensa membership not withstanding.   You constantly berate people because you don't know how to be nice.   Unfortunately, most Mensa members seem to have similar difficulty with people, as whatever they gained in IQ, they lost in people skills.   Tried involving myself in a Mensa group, just to see if I might find kindred folk there, but couldn't get a conversation going that would last.   It was a waste of my time, and the last thing I need is to join a bunch of social misfits.

    Steve (aka sgmunson) πŸ™‚ πŸ™‚ πŸ™‚
    Rent Servers for Income (picks and shovels strategy)

  • jcelko212 32090 - Tuesday, March 5, 2019 9:30 AM

    ipervez784 - Monday, March 4, 2019 4:23 PM

    jcelko212 32090 - Monday, March 4, 2019 1:55 PM

    ipervez784 - Sunday, March 3, 2019 8:32 PM

    For over 35 years, the convention on SQL forums has been to post DDL along with clear specs. This is basic netiquette in our community and failure to follow it is considered rude. I always beat people for this failure because it's been posted on all these forums all these decades. This means you didn't bother to read the agreements and conventions. And as far as my mental health goes, I still have my Mensa membership πŸ˜€

    Your Mensa membership and 6.00 will buy you a cup of coffee at Starbucks.

  • This is totally off-topic. My experience in Mensa was incredibly positive. The Atlanta chapter (I was actually president for one term) was fun, enjoyable and productive. One group of members did not like having children of other members at meetings. So the parents got their children tested and certified!

    This started a movement within the group to create a private school for Mensa level kids, and we did it! I don't know what your mental level is but it is really hell being a highly intelligent kid in a public school or even a private school when you're smarter than even your teachers.

    Today, I volunteer for TEALS, the Austin science Fest and the local APIE projects to work with kids. I must ask, what are you doing? A physical contribution somewhere? Books for the culture as a whole? Any contribution whatsoever? When I Google it. I can't find anything at all.

    Please post DDL and follow ANSI/ISO standards when asking for help. 

  • Lynn/Sgmunson - some posts have been take off this thread, so some of the context is now missing.

  • ipervez784 - Sunday, March 3, 2019 8:32 PM

    Can you Please show me that how can we use EXISTS FUNCTION WITH 3 OR MORE TABLE. Please show me the code and explanation. Thx for your cooperation

    As you've seen, sensible responses to this question are restricted to requests for more information. 
    Is this an exam or similar question or challenge? If not, what are you trying to do?

    β€œWrite the query the simplest way. If through testing it becomes clear that the performance is inadequate, consider alternative query forms.” - Gail Shaw

    For fast, accurate and documented assistance in answering your questions, please read this article.
    Understanding and using APPLY, (I) and (II) Paul White
    Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden

  • jcelko212 32090 - Wednesday, March 6, 2019 3:17 PM

    This is totally off-topic. My experience in Mensa was incredibly positive. The Atlanta chapter (I was actually president for one term) was fun, enjoyable and productive. One group of members did not like having children of other members at meetings. So the parents got their children tested and certified!

    This started a movement within the group to create a private school for Mensa level kids, and we did it! I don't know what your mental level is but it is really hell being a highly intelligent kid in a public school or even a private school when you're smarter than even your teachers.

    Today, I volunteer for TEALS, the Austin science Fest and the local APIE projects to work with kids. I must ask, what are you doing? A physical contribution somewhere? Books for the culture as a whole? Any contribution whatsoever? When I Google it. I can't find anything at all.

    I have been volunteering to work with children for over 25 years in a variety of programs.  I don't have to defend myself to you or anyone else.

Viewing 10 posts - 1 through 9 (of 9 total)

You must be logged in to reply to this topic. Login to reply