Orphan Records (Joined tables)

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • paul

    Orphan Records (Joined tables)

    Given this setup:

    inventory.itemI D

    item.itemID
    item.descriptio n


    I want a list of item descriptions which do NOT have an inventory
    record. Any ideas? I did this before in MS Access as I recall by making
    a query of things with inventory only then excluding those but I can't
    even recall how to do that now. I'm working with php/mysql now and had
    some luck generating aql with Access but not for this one.
  • paul

    #2
    Re: Orphan Records (Joined tables)

    paul wrote:
    [color=blue]
    > Given this setup:
    >
    > inventory.itemI D
    >
    > item.itemID
    > item.descriptio n
    >
    >
    > I want a list of item descriptions which do NOT have an inventory
    > record. Any ideas? I did this before in MS Access as I recall by making
    > a query of things with inventory only then excluding those but I can't
    > even recall how to do that now. I'm working with php/mysql now and had
    > some luck generating aql with Access but not for this one.[/color]


    I got it (pretty simple in access and works on mysql):

    SELECT plants.plantID, description.lat in_name
    FROM description LEFT JOIN plants ON description.id = plants.descript ion_id
    WHERE (((plants.plant ID) Is Null));

    Comment

    Working...