Skip to content
Advertisement

get newest duplicated records ids from 2 tables sql

i have two tables:

Table 1

Table 2

The result should be for this particular case:

[[2], [4], [1], [2], [3], [4]]

we should get the newest ids when column_1 and column_2 are duplicated in both tables.

i’ve been trying with something like this one:

But i’m getting [[1], [3]]

Expected result with ids from both tables:

[[2], [4], [1], [2], [3], [4]]

2, 4 are ids from the first table and 1, 2, 3, 4 are ids from the second table

Advertisement

Answer

may be this is what you want :

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement