By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
select version();
version() |
---|
8.0.30 |
CREATE TABLE table1 (columnB INTEGER);
INSERT INTO table1 VALUES
(1256),
(12345),
(1256),
(5678),
(1256),
(78905)
Records: 6 Duplicates: 0 Warnings: 0
CREATE TABLE table2 (columnA INTEGER);
INSERT INTO table2 VALUES
(12345),
(56789),
(34890),
(78905)
Records: 4 Duplicates: 0 Warnings: 0
SELECT table1.columnB
FROM table1
INNER JOIN table2 ON table2.columnA = table1.columnB
columnB |
---|
12345 |
78905 |