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 `dg_catalog_category_entity_varchar` AS `t_d` INNER JOIN `dg_catalog_category_entity` AS `e` ON e.entity_id = t_d.entity_id LEFT JOIN `dg_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 (275, 170, 26, 2)) AND (t_d.attribute_id IN ('60', '63')) AND (t_d.store_id = IFNULL(t_s.store_id, 0)) UNION ALL 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 `dg_catalog_category_entity_datetime` AS `t_d` INNER JOIN `dg_catalog_category_entity` AS `e` ON e.entity_id = t_d.entity_id LEFT JOIN `dg_catalog_category_entity_datetime` 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 (275, 170, 26, 2)) AND (t_d.attribute_id IN ('61', '62')) AND (t_d.store_id = IFNULL(t_s.store_id, 0)) UNION ALL 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 `dg_catalog_category_entity_text` AS `t_d` INNER JOIN `dg_catalog_category_entity` AS `e` ON e.entity_id = t_d.entity_id LEFT JOIN `dg_catalog_category_entity_text` 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 (275, 170, 26, 2)) AND (t_d.attribute_id IN ('64')) AND (t_d.store_id = IFNULL(t_s.store_id, 0)) UNION ALL 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 `dg_catalog_category_entity_int` AS `t_d` INNER JOIN `dg_catalog_category_entity` AS `e` ON e.entity_id = t_d.entity_id LEFT JOIN `dg_catalog_category_entity_int` 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 (275, 170, 26, 2)) AND (t_d.attribute_id IN ('71')) AND (t_d.store_id = IFNULL(t_s.store_id, 0))