joining 3 tables

Discussion in 'Databases' started by billybrag, Oct 6, 2006.

  1. #1
    Hello all,

    I need to get information from 3 tables and each table has "products_id"

    so i have the tables

    PRODUCTS
    PRODUCTS_DESCRIPTION
    PRODUCTS_TO_CATEGORIES

    and i want to get all of the info from each table, ie so i have a full set for a particular row.

    How would i do this please

    Mike
     
    billybrag, Oct 6, 2006 IP
  2. kjewat

    kjewat Active Member

    Messages:
    149
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    53
    #2
    Something like this... (for inner joins..)

    SELECT * FROM PRODUCTS P, PRODUCT_DESCRIPTION PD, PRODUCTS_TO_CATEGORIES PC WHERE P.products_id=PD.products_id AND PC.products_id=PD.products_id
     
    kjewat, Oct 6, 2006 IP
  3. T0PS3O

    T0PS3O Feel Good PLC

    Messages:
    13,219
    Likes Received:
    777
    Best Answers:
    0
    Trophy Points:
    0
    #3
    What our Norwegian friend said.

    Hacking up osCommerce are you?
     
    T0PS3O, Oct 6, 2006 IP
  4. billybrag

    billybrag Peon

    Messages:
    324
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #4
    hmm, yeah, I have written a new shop so that i can get away from the dreaded osc,

    Im just trying to get all the products out in a nicer format so i can drop them into a leaner, meaner db :)

    thanks kjewat
     
    billybrag, Oct 6, 2006 IP