Select Email From Parent Table if it Exists More than 3 times in Child Table?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Mudassir
    New Member
    • May 2012
    • 85

    Select Email From Parent Table if it Exists More than 3 times in Child Table?

    Dear all
    i have 2 tables
    table 1
    email name
    email1@gmail.co m name 1
    email3e3@gmail. com name 2

    table 2
    id email
    1 email1@gmail.co m
    2 email1@gmail.co m
    3 email1@gmail.co m
    4 email3e3@gmail. com

    i want to write query to select email from table 1 only if the email in table 2 exists more than 2.
    any help will be greatly appreciated.
    the output will be only
    email1@gmail.co m

    Regards:
  • Rabbit
    Recognized Expert MVP
    • Jan 2007
    • 12517

    #2
    Run an aggregate query that returns the count grouping by email id and join that to table 1.

    Comment

    • Mudassir
      New Member
      • May 2012
      • 85

      #3
      can you plz write a sample ??

      Comment

      • Rabbit
        Recognized Expert MVP
        • Jan 2007
        • 12517

        #4
        We try not to do the work for the asker because they are less likely to learn something useful. Please make an attempt and we can point you in the right direction.

        Comment

        Working...