• >> I am having issues with the following script. I have 3 tables that link together. <<

    We do not use "link" in RDBMS; that is assembly language. We have references and we do joins, which are totally different concepts. If you would read the posting rules for the forum, you would have seen the DDL requirement. Now we have to guess at things. The first thing we notice is that your tables have only one row in them! Tables model sets; sets have a collective or plural name by their nature.

    | Since the row in your result set contains only columns and aggregates from the owners table, why are you doing a join to these other tables? We have no idea what the keys are for any of the tables or anything else about them. I am bothered by things like vague "_id" column names. Who references who? How does someone perform the role of "_person" in the data model? In a valid data model things have precise names. And of also, data elements do not change names from table to table! SQL is based on logic and not violates the most fundamental law of logic; the Law of Identity.

    Non-SQL programmers who think that links exist in RDBMS will fake pointer chains with GUID, IDENTITY or other non-relational devices. This is one of many reasons we need DDL. When I see things like "E.dp_id = I.dpi_dp_id" and "O.ow_id = E.dp_person", I get scared :w00t:

    >> What I need to do is find owners that have items with statuses as 7 and (1-15). <<

    Did you notice that these two conditions overlap? Perhaps you can do it with something like this (after you correct the DDL and get proper keys):

    SELECT DISTINCT O.dp_id, O.ow_title, O.ow_fore_name, O.ow_sur_name

    FROM Dp_Owners AS O

    WHERE EXISTS(SELECT *

    FROM Dp_Entries AS E,

    Dp_Items AS I

    WHERE O.dp_id = E.dp_id

    AND E.dp_id = I.dp_id

    AND I.dpi_status BETWEEN '01' AND '15');

    Books in Celko Series for Morgan-Kaufmann Publishing
    Analytics and OLAP in SQL
    Data and Databases: Concepts in Practice
    Data, Measurements and Standards in SQL
    SQL for Smarties
    SQL Programming Style
    SQL Puzzles and Answers
    Thinking in Sets
    Trees and Hierarchies in SQL