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

    Join Date
    Apr 2012
    Posts
    2
    Rep Power
    0

    View - Join displays duplicate rows?


    The view below creates, however displays duplicate rows. Why is this may I ask?


    CREATE OR REPLACE VIEW customer_order_vw
    AS
    SELECT
    a.customer_id,
    a.name,
    a.city,
    a.state,
    a.zip,
    a.discount_percent,
    b.order_id,
    b.order_date,
    c.product_id,
    c.qty_ordered,
    d.description,
    d.unit_price

    FROM customer a
    INNER JOIN order_master b
    ON a.customer_id = b.customer_id
    INNER JOIN order_detail c
    ON b.order_id = c.order_id
    INNER JOIN product d
    ON c.product_id = d.product_id
  2. #2
  3. Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Sep 2006
    Posts
    844
    Rep Power
    387

    Cool


    Originally Posted by new2sql2
    The view below creates, however displays duplicate rows. Why is this may I ask?
    Perhaps because you have duplicate data?

IMN logo majestic logo threadwatch logo seochat tools logo