#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2003
    Posts
    2
    Rep Power
    0

    How do i get same data sting in a same tabe with diffrent id's


    he guys

    I have a problem, please help me..........

    There is a table called delivery types in my database, and it contain delivery type and product id.
    Eg.
    productId Dilyvarytype

    101 By Sea, By Air, By Currier
    102 By Air, By Currier
    102 By Air
    103 Currier, By Air


    I need to do a SQL quarry and take common delivery methods related to all products
    EG.

    By Air

    How do I do this, is any body know how to quarry this?

    Thanks and regards
    ProDesigner.
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2003
    Location
    Cincinnati, OH USA
    Posts
    111
    Rep Power
    11
    Your database design, in my opinion, is messed up.

    This is a many-to-many relationship, and you should then have 3 tables instead of 1.

    Product Table
    ============
    ProductID
    ProductDescription
    etc...


    DeliveryType Table
    ============
    DeliveryTypeID
    DeliveryTypeDescription
    etc...


    ProductDeliveryTypes Table
    ====================
    ProductDeliveryTypeID
    ProductID
    DeliveryTypeID

    Then you should be able to query easier.
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2003
    Posts
    3
    Rep Power
    0
    I agree that this should have been broken out into another table... but since it isn't you could do the following:

    SELECT ProductID FROM [Table]
    WHERE DeliveryType LIKE '%AIR%'

    This will return all productID where the word "AIR" appears anywhere in the deliveryType field.... But, again, this is much less efficient than if you had them in a separate table.
  6. #4
  7. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2003
    Posts
    2
    Rep Power
    0

    t


    thanks guys i got through the problem.

IMN logo majestic logo threadwatch logo seochat tools logo