I have these two tables:
CREATE TABLE `config_support_departments` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `title` varchar(200) NOT NULL DEFAULT '', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE `support_tickets_filters` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `filter_departments` json DEFAULT NULL, PRIMARY KEY (`id`), ) ENGINE=InnoDB DEFAULT CHARSET=utf8; config_support_departments:
+----+-------------------------+ | id | title | +----+-------------------------+ | 1 | Projects / File Support | | 2 | Sales Support | | 3 | IT Support | +----+-------------------------+ support_tickets_filters:
+----+--------------------+ | id | filter_departments | +----+--------------------+ | 1 | ["2", "3"] | +----+--------------------+ What I need is when query the support_tickets_filters table to also include the title from the config_support_departments table. Hence, the result should be something like this:
+----+-----------------------------------------------+ | id | filter_departments | +----+-----------------------------------------------+ | 1 | {"2":"Sales Support","3":"IT Support"} | +----+-----------------------------------------------+