Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2004
    Posts
    5

    Unanswered: exists: the absence of data

    Can someone please tell me how to check if a record does not exist (as a secondary key) in one table when it exists in another as a primary key. The actual value of the record is not known ahead of time. I am dealing in sybase t-sql if that makes a difference. Also, can anyone recommend a good tutorial on t-sql.

    Thanks

  2. #2
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    You can use the NOT EXISTS condition in your WHERE clause to find rows in the parent table that have no related rows in the child table.

    There are lots of good books on Transact-SQL, as well as SQL in general. If all you need is a good introduction, the SQL for Dummies will probably do the job.

    -PatP

  3. #3
    Join Date
    Apr 2004
    Posts
    5

    Thanks

    Thanks Pat. Works exactly how I wanted it. Thanks for the book rec. too.

    Adam

    Originally posted by Pat Phelan
    You can use the NOT EXISTS condition in your WHERE clause to find rows in the parent table that have no related rows in the child table.

    There are lots of good books on Transact-SQL, as well as SQL in general. If all you need is a good introduction, the SQL for Dummies will probably do the job.

    -PatP

Posting Permissions

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