If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Cartesian product

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-12-08, 09:09
usDB2 usDB2 is offline
Registered User
 
Join Date: May 2008
Posts: 39
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.
Reply With Quote
  #2 (permalink)  
Old 08-12-08, 09:38
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
yes it will
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #3 (permalink)  
Old 08-12-08, 11:29
dav1mo dav1mo is offline
Registered User
 
Join Date: Dec 2007
Location: Richmond, VA
Posts: 782
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
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On