SELECT 
1 language_id,
ccf.entity_id categories_id,
IF(ccf.parent_id<2,0,ccf.parent_id) parent_id,
ccevur.value categories_image,
0 sort_order,
0 as TCGroupID,
ccev.value categories_name 

from 
catalog_category_entity ccf  
 join 
catalog_category_entity_varchar ccev on ccev.entity_id = ccf.entity_id 
join eav_attribute eava on ccev.attribute_id  = eava.attribute_id and eava.attribute_code = 'name' and ccev.store_id =1
left join 
catalog_category_entity_varchar ccevur on ccevur.entity_id = ccf.entity_id 
and ccevur.attribute_id = (select eavb.attribute_id from
eav_attribute eavb where ccevur.attribute_id  = eavb.attribute_id 
and eavb.attribute_code = 'image' ) and ccevur.store_id =1 
 and ccf.entity_id > 1