Avatar of sam2929
sam2929 asked on

cartesian join

Hi,

i have table A

A_ID  A_TEXT
1    employee
5    terminated
9     inactive

Table B

B_ID   B_TEXT
11      hOURLY
12      PARTTIME
15      >6 MONTH

I want target_a_b to look like below

A_ID  A_TEXT     B_ID   B_TEXT
1    employee       11      hOURLY
1    employee       12      PARTTIME
1    employee       15      >6 MONTH
5    terminated       11      hOURLY
5    terminated       12      PARTTIME
5    terminated       15      >6 MONTH
9     inactive           11      hOURLY
9     inactive       12      PARTTIME
9     inactive       15      >6 MONTH



I did try FULL Outer join but not giving desire results

Select  *  From Table_ A a
FULL OUTER Join Table_B b
ON TRIM(a.A_ID) = TRIM(b.B_ID)
Oracle Database

Avatar of undefined
Last Comment
PortletPaul

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Argenti

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
slightwv (䄆 Netminder)

To get a cartesian, remove the join all together:

select a_id, a_text, b_id, b_text from table_a, table_b;
PortletPaul

:(

as proponent of ANSI join syntax: never leave it open for mis-interpretation

select *
from table1
cross join table2
;

now you know (and the folks that follow) that the Cartesian product is deliberate
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck