I want to create what I thought was a simple select query.
I have 2 tables.
COMPONENTS
UNIT_ID
COLL_DATE
ATTRIBUTES
ATTRIB_CODE
UNIT_ID
The COMPONENTS table lists each item only once, the ATTRIBUTES will have anywhere from no ATTRIB_CODE values to several.
Here's and example:
What I want to select are all UNIT_ID between 1/1/2011 and 3/28/2011 that do not have the ATTRIB_CODE of def. So if a UNIT_ID is listed in the ATTRIBUTES table multiple times, I do not want it on the list if it has that attribute. In this example I want a list that inlcudes 456 and 789.
Thanks
I have 2 tables.
COMPONENTS
UNIT_ID
COLL_DATE
ATTRIBUTES
ATTRIB_CODE
UNIT_ID
The COMPONENTS table lists each item only once, the ATTRIBUTES will have anywhere from no ATTRIB_CODE values to several.
Here's and example:
Code:
COMPONENTS
123 1/2/2011
456 3/5/2011
789 2/1/2011
Code:
ATTRIBUTES
123 abc
123 def
123 ghi
456 abc
456 ghi
What I want to select are all UNIT_ID between 1/1/2011 and 3/28/2011 that do not have the ATTRIB_CODE of def. So if a UNIT_ID is listed in the ATTRIBUTES table multiple times, I do not want it on the list if it has that attribute. In this example I want a list that inlcudes 456 and 789.
Thanks