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
ASKER CERTIFIED SOLUTION
Avatar of Argenti
Argenti
Flag of France image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of slightwv (䄆 Netminder)
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;
Avatar of PortletPaul
PortletPaul
Flag of Australia image

:(

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
Oracle Database
Oracle Database

Oracle is an object-relational database management system. It supports a large number of languages and application development frameworks. Its primary languages are SQL, PL/SQL and Java, but it also includes support for C and C++. Oracle also has its own enterprise modules and application server software.

81K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo