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 `mghd_catalog_category_entity_varchar` AS `t_d` INNER JOIN `mghd_catalog_category_entity` AS `e` ON e.entity_id = t_d.entity_id LEFT JOIN `mghd_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 (40, 20, 19, 394, 388, 25, 16, 422, 530, 610, 361, 539, 615, 659, 516, 603, 72, 348, 395, 538, 616, 660, 17, 515, 604, 541, 624, 661, 37, 531, 385, 605, 409, 391, 649, 663, 38, 518, 508, 543, 668, 18, 34, 184, 447, 73, 544, 673, 33, 35, 382, 435, 75, 352, 32, 221, 456, 540, 27, 451, 128, 387, 29, 449, 74, 41, 68, 31, 452, 76, 423, 80, 448, 424, 376, 453, 425, 450, 426, 167, 455, 427, 533, 520, 457, 428, 350, 429, 179, 454, 363, 438, 65, 545, 26, 338, 521, 44, 381, 62, 176, 30, 386, 383, 60, 689, 24, 522, 339, 523, 546, 618, 617, 625, 662, 664, 669, 674, 341, 524, 547, 619, 648, 626, 665, 681, 349, 525, 548, 620, 627, 666, 682, 594, 526, 621, 641, 667, 527, 622, 647, 670, 528, 623, 671, 342, 529, 628, 672, 629, 675, 630, 676, 631, 677, 340, 632, 678, 344, 633, 679, 557, 634, 680, 635, 683, 636, 684, 637, 685, 638, 686, 639, 687, 640, 643, 644, 645, 651)) AND (t_d.attribute_id IN (45, 253, 260, 261, 262, 263, 264, 265, 266, 267, 283, 279, 284, 287, 290)) 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 `mghd_catalog_category_entity_text` AS `t_d` INNER JOIN `mghd_catalog_category_entity` AS `e` ON e.entity_id = t_d.entity_id LEFT JOIN `mghd_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 (40, 20, 19, 394, 388, 25, 16, 422, 530, 610, 361, 539, 615, 659, 516, 603, 72, 348, 395, 538, 616, 660, 17, 515, 604, 541, 624, 661, 37, 531, 385, 605, 409, 391, 649, 663, 38, 518, 508, 543, 668, 18, 34, 184, 447, 73, 544, 673, 33, 35, 382, 435, 75, 352, 32, 221, 456, 540, 27, 451, 128, 387, 29, 449, 74, 41, 68, 31, 452, 76, 423, 80, 448, 424, 376, 453, 425, 450, 426, 167, 455, 427, 533, 520, 457, 428, 350, 429, 179, 454, 363, 438, 65, 545, 26, 338, 521, 44, 381, 62, 176, 30, 386, 383, 60, 689, 24, 522, 339, 523, 546, 618, 617, 625, 662, 664, 669, 674, 341, 524, 547, 619, 648, 626, 665, 681, 349, 525, 548, 620, 627, 666, 682, 594, 526, 621, 641, 667, 527, 622, 647, 670, 528, 623, 671, 342, 529, 628, 672, 629, 675, 630, 676, 631, 677, 340, 632, 678, 344, 633, 679, 557, 634, 680, 635, 683, 636, 684, 637, 685, 638, 686, 639, 687, 640, 643, 644, 645, 651)) AND (t_d.attribute_id IN (251, 254, 255, 256, 257, 258, 259, 269, 270, 273, 285, 286, 288, 289)) 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 `mghd_catalog_category_entity_int` AS `t_d` INNER JOIN `mghd_catalog_category_entity` AS `e` ON e.entity_id = t_d.entity_id LEFT JOIN `mghd_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 (40, 20, 19, 394, 388, 25, 16, 422, 530, 610, 361, 539, 615, 659, 516, 603, 72, 348, 395, 538, 616, 660, 17, 515, 604, 541, 624, 661, 37, 531, 385, 605, 409, 391, 649, 663, 38, 518, 508, 543, 668, 18, 34, 184, 447, 73, 544, 673, 33, 35, 382, 435, 75, 352, 32, 221, 456, 540, 27, 451, 128, 387, 29, 449, 74, 41, 68, 31, 452, 76, 423, 80, 448, 424, 376, 453, 425, 450, 426, 167, 455, 427, 533, 520, 457, 428, 350, 429, 179, 454, 363, 438, 65, 545, 26, 338, 521, 44, 381, 62, 176, 30, 386, 383, 60, 689, 24, 522, 339, 523, 546, 618, 617, 625, 662, 664, 669, 674, 341, 524, 547, 619, 648, 626, 665, 681, 349, 525, 548, 620, 627, 666, 682, 594, 526, 621, 641, 667, 527, 622, 647, 670, 528, 623, 671, 342, 529, 628, 672, 629, 675, 630, 676, 631, 677, 340, 632, 678, 344, 633, 679, 557, 634, 680, 635, 683, 636, 684, 637, 685, 638, 686, 639, 687, 640, 643, 644, 645, 651)) AND (t_d.attribute_id IN (252, 268, 271, 272, 282, 281, 280)) AND (t_d.store_id = IFNULL(t_s.store_id, 0))