A simple join question

Discussion forum about all things SqlBase or SqlTalk
FRBhote
India
Posts: 2206
Joined: 09 Mar 2017, 05:32
Location: Hyderabad, India

A simple join question

Post by FRBhote » 14 Jan 2022, 08:34

I have two tables of which the rows are:

Code: Select all

Table A                        Table B
A                                 A
B                                 C
How do I join them to get:

A
B
C

?

thomas.uttendorfer
Site Admin
Site Admin
Germany
Posts: 292
Joined: 05 Mar 2017, 17:19
Location: Munich Germany

Re: A simple join question

Post by thomas.uttendorfer » 14 Jan 2022, 16:20

Hi FRBhote,

how about a UNION?

Code: Select all

SELECT Col1 FROM TableA
UNION
SELECT Col2 FROM TableB;
Col1 and Col2 must be of the same datatype.

Regards
Thomas
Thomas Uttendorfer
[ frevel & fey ] Software-System GmbH
https://thomasuttendorfer.wordpress.com/

a_sivababu
India
Posts: 505
Joined: 10 Mar 2017, 08:46
Location: Chennai,India

Re: A simple join question

Post by a_sivababu » 15 Jan 2022, 06:05

may be full-outer join if need to go with join.

Thanks!
Siva A

FRBhote
India
Posts: 2206
Joined: 09 Mar 2017, 05:32
Location: Hyderabad, India

Re: A simple join question

Post by FRBhote » 17 Jan 2022, 05:31

A view of a union would work, but views are slow in SB and inserting 400,000 rows into a temp table would also be slow.

Return to “SqlBase General Discussion”

Who is online

Users browsing this forum: [Ccbot] and 2 guests