DBAsupport.com Forums - Powered by vBulletin
Results 1 to 2 of 2

Thread: select count with NO children?

  1. #1
    Join Date
    May 2008
    Posts
    1

    select count with NO children?

    I have a USER table with a child ACCOUNT table

    USER <--- ACCOUNT(fk USER_ID)

    I want to find all the users that have NO accounts?

    I can find users that have 1,2,3,N accounts, just not 0 accounts!

    help!

  2. #2
    Join Date
    Mar 2007
    Location
    Ft. Lauderdale, FL
    Posts
    3,555
    Have you heard about inline views?
    I would count from USER where the USER does not exists on ACCOUNT.

    Show us your best effort.
    Pablo (Paul) Berzukov

    Author of Understanding Database Administration available at amazon and other bookstores.

    Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width