replace into catalog_category_flat_store_1 (
entity_id,parent_id,created_at,updated_at,path,position,level,children_count
) select entity_id,parent_id,created_at,updated_at,path,position,level,children_count from catalog_category_entity where entity_id =<@KEY@> 
@@GO@@
update catalog_category_flat_store_1 set all_children =  ( select value from  catalog_category_entity_text a where a.entity_id= catalog_category_flat_store_1.entity_id and a.attribute_id = 54 order by a.store_id limit 1 ) where  entity_id =<@KEY@> 
@@GO@@
update catalog_category_flat_store_1 set available_sort_by =  ( select value from  catalog_category_entity_text a where a.entity_id= catalog_category_flat_store_1.entity_id and a.attribute_id = 65 order by a.store_id limit 1 ) where  entity_id =<@KEY@> 
@@GO@@
update catalog_category_flat_store_1 set children =  ( select value from  catalog_category_entity_text a where a.entity_id= catalog_category_flat_store_1.entity_id and a.attribute_id = 56 order by a.store_id limit 1 ) where  entity_id =<@KEY@> 
@@GO@@
update catalog_category_flat_store_1 set custom_apply_to_products =  ( select value from  catalog_category_entity_int a where a.entity_id= catalog_category_flat_store_1.entity_id and a.attribute_id = 69 order by a.store_id limit 1 ) where  entity_id =<@KEY@> 
@@GO@@
update catalog_category_flat_store_1 set custom_design =  ( select value from  catalog_category_entity_varchar a where a.entity_id= catalog_category_flat_store_1.entity_id and a.attribute_id = 58 order by a.store_id limit 1 ) where  entity_id =<@KEY@> 
@@GO@@
update catalog_category_flat_store_1 set custom_design_from =  ( select value from  catalog_category_entity_datetime a where a.entity_id= catalog_category_flat_store_1.entity_id and a.attribute_id = 59 order by a.store_id limit 1 ) where  entity_id =<@KEY@> 
@@GO@@
update catalog_category_flat_store_1 set custom_design_to =  ( select value from  catalog_category_entity_datetime a where a.entity_id= catalog_category_flat_store_1.entity_id and a.attribute_id = 60 order by a.store_id limit 1 ) where  entity_id =<@KEY@> 
@@GO@@
update catalog_category_flat_store_1 set custom_layout_update =  ( select value from  catalog_category_entity_text a where a.entity_id= catalog_category_flat_store_1.entity_id and a.attribute_id = 62 order by a.store_id limit 1 ) where  entity_id =<@KEY@> 
@@GO@@
update catalog_category_flat_store_1 set custom_use_parent_settings =  ( select value from  catalog_category_entity_int a where a.entity_id= catalog_category_flat_store_1.entity_id and a.attribute_id = 68 order by a.store_id limit 1 ) where  entity_id =<@KEY@> 
@@GO@@
update catalog_category_flat_store_1 set default_sort_by =  ( select value from  catalog_category_entity_varchar a where a.entity_id= catalog_category_flat_store_1.entity_id and a.attribute_id = 66 order by a.store_id limit 1 ) where  entity_id =<@KEY@> 
@@GO@@
update catalog_category_flat_store_1 set description =  ( select value from  catalog_category_entity_text a where a.entity_id= catalog_category_flat_store_1.entity_id and a.attribute_id = 44 order by a.store_id limit 1 ) where  entity_id =<@KEY@> 
@@GO@@
update catalog_category_flat_store_1 set display_mode =  ( select value from  catalog_category_entity_varchar a where a.entity_id= catalog_category_flat_store_1.entity_id and a.attribute_id = 49 order by a.store_id limit 1 ) where  entity_id =<@KEY@> 
@@GO@@
update catalog_category_flat_store_1 set filter_price_range =  ( select value from  catalog_category_entity_decimal a where a.entity_id= catalog_category_flat_store_1.entity_id and a.attribute_id = 70 order by a.store_id limit 1 ) where  entity_id =<@KEY@> 
@@GO@@
update catalog_category_flat_store_1 set image =  ( select value from  catalog_category_entity_varchar a where a.entity_id= catalog_category_flat_store_1.entity_id and a.attribute_id = 45 order by a.store_id limit 1 ) where  entity_id =<@KEY@> 
@@GO@@
update catalog_category_flat_store_1 set include_in_menu =  ( select value from  catalog_category_entity_int a where a.entity_id= catalog_category_flat_store_1.entity_id and a.attribute_id = 67 order by a.store_id limit 1 ) where  entity_id =<@KEY@> 
@@GO@@
update catalog_category_flat_store_1 set is_active =  ( select value from  catalog_category_entity_int a where a.entity_id= catalog_category_flat_store_1.entity_id and a.attribute_id = 42 order by a.store_id limit 1 ) where  entity_id =<@KEY@> 
@@GO@@
update catalog_category_flat_store_1 set is_anchor =  ( select value from  catalog_category_entity_int a where a.entity_id= catalog_category_flat_store_1.entity_id and a.attribute_id = 51 order by a.store_id limit 1 ) where  entity_id =<@KEY@> 
@@GO@@
update catalog_category_flat_store_1 set landing_page =  ( select value from  catalog_category_entity_int a where a.entity_id= catalog_category_flat_store_1.entity_id and a.attribute_id = 50 order by a.store_id limit 1 ) where  entity_id =<@KEY@> 
@@GO@@
update catalog_category_flat_store_1 set meta_description =  ( select value from  catalog_category_entity_text a where a.entity_id= catalog_category_flat_store_1.entity_id and a.attribute_id = 48 order by a.store_id limit 1 ) where  entity_id =<@KEY@> 
@@GO@@
update catalog_category_flat_store_1 set meta_keywords =  ( select value from  catalog_category_entity_text a where a.entity_id= catalog_category_flat_store_1.entity_id and a.attribute_id = 47 order by a.store_id limit 1 ) where  entity_id =<@KEY@> 
@@GO@@
update catalog_category_flat_store_1 set meta_title =  ( select value from  catalog_category_entity_varchar a where a.entity_id= catalog_category_flat_store_1.entity_id and a.attribute_id = 46 order by a.store_id limit 1 ) where  entity_id =<@KEY@> 
@@GO@@
update catalog_category_flat_store_1 set name =  ( select value from  catalog_category_entity_varchar a where a.entity_id= catalog_category_flat_store_1.entity_id and a.attribute_id = 41 order by a.store_id limit 1 ) where  entity_id =<@KEY@> 
@@GO@@
update catalog_category_flat_store_1 set page_layout =  ( select value from  catalog_category_entity_varchar a where a.entity_id= catalog_category_flat_store_1.entity_id and a.attribute_id = 61 order by a.store_id limit 1 ) where  entity_id =<@KEY@> 
@@GO@@
update catalog_category_flat_store_1 set path_in_store =  ( select value from  catalog_category_entity_text a where a.entity_id= catalog_category_flat_store_1.entity_id and a.attribute_id = 55 order by a.store_id limit 1 ) where  entity_id =<@KEY@> 
@@GO@@
update catalog_category_flat_store_1 set thumbnail =  ( select value from  catalog_category_entity_varchar a where a.entity_id= catalog_category_flat_store_1.entity_id and a.attribute_id = 132 order by a.store_id limit 1 ) where  entity_id =<@KEY@> 
@@GO@@
update catalog_category_flat_store_1 set url_key =  ( select value from  catalog_category_entity_varchar a where a.entity_id= catalog_category_flat_store_1.entity_id and a.attribute_id = 43 order by a.store_id limit 1 ) where  entity_id =<@KEY@> 
@@GO@@
update catalog_category_flat_store_1 set url_path =  ( select value from  catalog_category_entity_varchar a where a.entity_id= catalog_category_flat_store_1.entity_id and a.attribute_id = 57 order by a.store_id limit 1 ) where  entity_id =<@KEY@> 
@@GO@@