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 (168982, 168986, 168988, 169047, 3, 9, 138655, 6, 4, 169048, 169049, 169050, 169051, 169052, 169053, 169054, 169055, 169056, 169057, 169058, 169059, 169060, 169115, 168978, 168979, 168981, 169098, 169099, 169100, 169101, 169102, 169103, 169104, 169105, 169116, 169107, 169108, 169109, 169110, 169111, 169112, 169113, 169114, 168984, 168987, 168989, 168991, 168994, 168995, 168996, 168997, 168998, 168999, 169000, 169001, 169002, 169003, 169004, 169005, 169006, 169007, 169008, 169009, 169010, 169106, 169061, 169062, 169063, 169065, 169066, 169067, 169148, 138654, 146968, 55, 169149, 10, 21, 168969, 168970, 17, 28, 14, 30, 15, 11, 34, 27, 16, 24, 138665, 18, 29, 13, 322, 51720)) AND (t_d.attribute_id IN (45)) AND (t_d.store_id = IFNULL(t_s.store_id, 0))