SELECT 
  REPLACE(id_path, '238', '') 
FROM 
  cscart_categories 
WHERE 
  category_id = 238

Query time 0.00018

Explain
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE cscart_categories const PRIMARY,p_category_id PRIMARY 3 const 1

Result

REPLACE(id_path, '238', '')
166/234/