I'm not sure what you mean by "sysdate for all customers". But, the join
is not doing what you expect.
Just do the aggregation once:
select o.customer_id, substring_index(group_concat(date order by date desc),',', 1) as order1,
(case when count(*) >=2 then substring_index(substring_index(group_concat(date order by date desc), ',', 2), ',', -1)end) as order2,
(case when count(*) >=3 then substring_index(substring_index(group_concat(date order by date desc), ',', -1)end) as order3,
(case when count(*) >=4 then substring_index(substring_index(group_concat(date order by date desc), ',', 4), ',', -1)end) as order4,
(case when count(*) >=5 then substring_index(substring_index(group_concat(date order by date desc), ',', 5), ',', -1)end) as order5
from orders o
where country_id='27'
group by customer_id