1

Topic: As 2 tables not on a key.

Prompt please.
Here there are two tables

SELECT TOP (1000) [CustomerName]
,[PayerName]
,[ItemRelation]
,[DocumentNum]
,[DocumentYear]
,[CustomerType]
,[k]
,[m0]
,[Action_Effect]
,[sum]
,[salesbefore]
FROM [Action]. [dbo]. [deduped2]

And

SELECT TOP (1000) [CustomerName]
,[PayerName]
,[ItemRelation]
,[DocumentNum]
,[DocumentYear]
,[CustomerType]
,[k]
,[m0]
,[Action_Effect]
,[sum]
,[salesbefore]
FROM [Action]. [dbo]. [FSEA]

In spite of the fact that their columns equally are called, the general key is not present.
There simply appropriate data which should be connected on columns
I.e.
In one table
And
In
In another



In summary should be
And
In



How so  2 labels?

2

Re: As 2 tables not on a key.

Kontox;

wrote:

i.e.
In one table
And
In
In another



In summary should be
And
In

Time should, means, will be

WITH TAB1 (FILLER) AS
(
SELECT ' A'
UNION ALL
SELECT ' B'
UNION ALL
SELECT ' A C'
);
TAB2 (FILLER) AS
(
SELECT ' D'
UNION ALL
SELECT ' E'
UNION ALL
SELECT ' F'
)
SELECT T1.FILLER
FROM TAB1 T1
UNION ALL
SELECT T2.FILLER
FROM TAB2 T2

3

Re: As 2 tables not on a key.

Kontox wrote:

As so  2 labels?

It  not  and to unite, that is it is necessary to use the operator UNION ALL

4

Re: As 2 tables not on a key.

alexeyvg wrote:

it is passed...
It  not  and to unite, that is it is necessary to use the operator UNION ALL