By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
CREATE TABLE IF NOT EXISTS `table1` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(99) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
INSERT INTO `table1` (`id`, `name`) VALUES
(2, 'Blablifdsfsdfsdfsd'),
(3, 'Fdsfsdfds');
CREATE TABLE IF NOT EXISTS `table2` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`container` int(10) unsigned NOT NULL,
`sort` int(3) unsigned NOT NULL,
`name` varchar(99) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
INSERT INTO `table2` (`id`, `container`, `sort`, `name`) VALUES
(3, 2, 0, 'Fsdfds'),
(4, 3, 0, 'Fsdfsdfds'),
(5, 3, 1, 'Fdsfsdfsd');
CREATE TABLE IF NOT EXISTS `table3` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`container` int(11) unsigned NOT NULL,
`choice` int(11) unsigned NOT NULL,
`sort` int(3) unsigned NOT NULL,
`type` varchar(20) NOT NULL DEFAULT '',
`refId` int(11) unsigned NOT NULL,
`extraCharge` float NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=23 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
INSERT INTO `table3` (`id`, `container`, `choice`, `sort`, `type`, `refId`, `extraCharge`) VALUES
(1, 2, 3, 0, 'category', 39, 0),
Records: 2 Duplicates: 0 Warnings: 0
Records: 3 Duplicates: 0 Warnings: 0
Records: 13 Duplicates: 0 Warnings: 0
Invalid use of group function