Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Jan 2007
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    find unrelated records

    I need to find records in one table without a match in another.

    Right now, I have three tables (staff, topic, topicstaff). There is a many-to-one relationship between topic and staff that's recorded in the topicstaff table. Each topic and each staff member has an ID. The topicstaff table is only these two columns.

    My question is, how do I find the topics aren't associated with a staff member? It should be easy as pulling the topic IDs from the topic table that aren't in the topicstaff table. Right?

    Any ideas?

    Thanks!

    :kevin
    My destiny waits for a sign from me.

  • #2
    Super Moderator guelphdad's Avatar
    Join Date
    Mar 2006
    Location
    St. Catharines, Ontario Canada
    Posts
    2,633
    Thanks
    4
    Thanked 148 Times in 139 Posts
    correct, use a subquery to do it.


  •  

    Posting Permissions

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