-
-
Notifications
You must be signed in to change notification settings - Fork 584
Closed
dolthub/go-mysql-server
#2205Labels
Description
environment:
CREATE TABLE `tablea` (
`id` int NOT NULL AUTO_INCREMENT,
`start` int NOT NULL,
`end` int NOT NULL,
`name` varchar(32),
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin;
INSERT INTO tablea (id, start, end, name) VALUES (1, 603000, 605001, 'test');
CREATE TABLE `tableb` (
`id` int NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin;
INSERT INTO tableb (id) VALUES (600000);
INSERT INTO tableb (id) VALUES (605000);
INSERT INTO tableb (id) VALUES (608000);query sql:
SELECT a.id
FROM (select 'test' as name) h
JOIN tablea a ON h.name = a.name
JOIN tableb b ON b.id between a.start AND a.end;Result set is empty. But there should be a record that can be found