SELECT `t_d`.`attribute_id`, `e`.`entity_id`, `t_d`.`value` AS `default_value`, `t_s`.`value` AS `store_value`, IF(t_s.value_id IS NULL, t_d.value, t_s.value) AS `value` FROM `catalog_category_entity_varchar` AS `t_d` INNER JOIN `catalog_category_entity` AS `e` ON e.entity_id = t_d.entity_id LEFT JOIN `catalog_category_entity_varchar` AS `t_s` ON t_s.attribute_id = t_d.attribute_id AND t_s.entity_id = t_d.entity_id AND t_s.store_id = 1 WHERE (e.entity_id IN (197, 205, 211, 209, 201, 221, 218, 255, 223, 214, 229, 298, 198, 202, 206, 249, 212, 215, 219, 222, 226, 230, 256, 299, 242, 236, 264, 210, 231, 297, 257, 228, 224, 296, 281, 300, 316, 235, 295, 253, 258, 240, 260, 262, 278, 199, 208, 207, 220, 254, 290, 266, 282, 284, 285, 292, 287, 279, 317, 227, 203, 234, 225, 289, 291, 268, 286, 269, 272, 276, 265, 318, 246, 204, 216, 213, 277, 237, 241, 273, 283, 294, 263, 288, 319, 247, 248, 232, 243, 259, 261, 320, 244, 233, 280, 217, 200)) AND (t_d.attribute_id IN ('45')) AND (t_d.store_id = IFNULL(t_s.store_id, 0))