#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2012
    Posts
    4
    Rep Power
    0

    Question Selecting unbooked items


    Am banging my head to find how to list unused items.
    I can list those items which have been used or allocated to a task on an insert query from a collection but those that remain unused escape my best efforts at coding. Any hints or guidlines or suggestions will be much appreciated. Am new on the mysql php platform.

    Best regards

    Peter
  2. #2
  3. Lord of the Dance
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Oct 2003
    Posts
    3,635
    Rep Power
    1945
    It will be easier to help if you include database structure and queries you tried with.

    Generally, you should get result with a query statement like this:
    Code:
    SELECT item
    FROM Collection
    WHERE item NOT IN (
           SELECT item 
           FROM items_in_use
          )
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2012
    Posts
    4
    Rep Power
    0

    Smile Continuation of unused field


    Originally Posted by MrFujin
    It will be easier to help if you include database structure and queries you tried with.

    Generally, you should get result with a query statement like this:
    Code:
    SELECT item
    FROM Collection
    WHERE item NOT IN (
           SELECT item 
           FROM items_in_use
          )
    My thanks for the speedy constructive fluid communication.

    I tried and failed many times with your suggestion but by continuous simplification I manged to get it going and then built it up again.

    Huge thanks


    Best regards Peter

IMN logo majestic logo threadwatch logo seochat tools logo