select count(bu_id) as c, mid(bu_address2, 1, elt((locate('', bu_address2) > 0) + 1, char_length(bu_address2), locate('', bu_address2)-2)) as k from bukken_sub where ( (bu_disp in ('', 1)) and ((((bu_type1 = '2' and bu_type2 = '1') or (bu_type1 = '1' and bu_costruct_cond = '1'))) or (bu_type1 = '2' and bu_type2 = '2') or (bu_type1 = '1' and bu_type2 = '1') or (bu_type1 = '3' and bu_type2 = '2')) and ( ( (1) and (((bu_type1 = '2' and bu_type2 = '1') or (bu_type1 = '1' and bu_costruct_cond = '1'))) ) or ( (1) and (bu_type1 = '2' and bu_type2 = '2') ) or ( (1) and (bu_type1 = '1' and bu_type2 = '1') ) or ( (1) and (bu_type1 = '3' and bu_type2 = '2') ) ) ) and ( (bu_disp in ('', 1)) and ((((bu_type1 = '2' and bu_type2 = '1') or (bu_type1 = '1' and bu_costruct_cond = '1')))) and (bu_price < 20000000) and (bu_price >= 10000000) and ((bu_bus1 = 0 or bu_bus1 is null) and bu_walk1 > 0 and bu_walk1 <= 20) and ((bu_full_address regexp 'Ķ')) and ( ( (1) and (((bu_type1 = '2' and bu_type2 = '1') or (bu_type1 = '1' and bu_costruct_cond = '1'))) and (((bu_rooms in ('4')))) ) ) ) group by kGot error 28 from storage engine