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 (24, 27, 28, 29, 30, 31, 189, 32, 33, 193, 34, 77, 101, 225, 226, 130, 131, 137, 142, 190, 367, 78, 102, 113, 126, 211, 233, 245, 143, 191, 194, 38, 79, 103, 174, 186, 129, 217, 220, 144, 192, 203, 80, 104, 114, 127, 253, 145, 195, 239, 105, 229, 231, 223, 146, 196, 219, 81, 106, 251, 134, 140, 197, 222, 82, 248, 176, 188, 135, 141, 232, 230, 83, 107, 116, 177, 128, 136, 366, 156, 178, 325, 40, 109, 118, 179, 365, 110, 180, 204, 41, 319, 120, 221, 199, 249, 87, 112, 208, 209, 200, 240, 162, 212, 181, 201, 42, 88, 182, 202, 43, 122, 213, 228, 237, 242, 243, 227, 183, 158, 90, 165, 123, 246, 363, 91, 166, 252, 216, 308, 92, 167, 250, 93, 168, 125, 185, 236, 244, 169, 247, 362, 94, 170, 215, 95, 171, 96, 172, 235, 224, 238, 214, 254, 218, 48, 49, 50, 51, 52, 361, 53, 54, 55)) AND (t_d.attribute_id IN (35)) AND (t_d.store_id = IFNULL(t_s.store_id, 0))