add batch remove batch split batch comment selection show hidden batches hide batch highlight batch
db<>fiddle
donate feedback about
By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
CREATE TABLE table1 (id, name);

INSERT INTO table1 VALUES (1, 'name1'), (2, 'name2'), (3, 'name3'), (4, 'name4'), (5, 'name5');

CREATE TABLE table2 (col);

INSERT INTO table2 VALUES (1), (2), (3);

SELECT *
FROM table1
ORDER BY id
LIMIT (SELECT COUNT(*) FROM table2);
id name
1 name1
2 name2
3 name3