Results 1 to 3 of 3
  1. #1
    Join Date
    May 2008
    Posts
    39

    Unanswered: Cartesian product

    Hi

    I have below qry

    SELECT
    c.COUNTRY_CD,
    c.COUNTRY_NM,
    A.DM_LINEAGE_ID
    FROM
    c c,
    c A
    WHERE
    A.DM= '2008-08-07 07:43:35.000000'
    AND A.p= 's';

    its returning values correctly...but since i dont ve a join between a and c tables
    will it result in cartesian product.
    please help.

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    yes it will
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    Dec 2007
    Location
    Richmond, VA
    Posts
    1,328
    Provided Answers: 5
    but that is much better than 1 I ran across years ago. It looked like this:

    Select 150 columns...

    from tab1 --@130million rows
    ,tab2 --@115million rows
    ,tab3 --@350million rows
    ,tab4 --@45million rows
    ,tab5 --@100million rows
    ,tab6 --@45million rows
    ,tab7 --@100million rows
    ,tab8 --@45million rows
    ,tab9 --@115million rows
    ,tab10 --@270million rows
    ,tab11 --@100million rows
    ,tab12 --@100million rows
    ,tab13 --@100million rows
    ,tab14 --@100million rows
    ,tab15 --@120million rows
    where tab1.non_indexed_col1 = ????;

    and the developer wanted to know why he wasn't getting resultset

    Dave

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •