How to name the column being the day of the week
<p>I have this appointment, but I had to put the day of the week.</p>

<pre><code>   select `a`.`aplicativo` AS `PROGRAMA`,
          sum((cast(`r`.`created_at` as date) = curdate())) AS `HOJE`,
          sum((cast(`r`.`created_at` as date) = (curdate() - 1))) AS `ONTEM`,
          sum((cast(`r`.`created_at` as date) = (curdate() - 2))) AS `2_DIAS`
   from (`registration` `r` 
         join `aplicativos` `a` on ((`r`.`app_id` = `a`.`id`))) 
   group by `r`.`app_id` 
</code></pre>

<p>I have already tried with the following command gives error.</p>

<pre><code>sum((cast(`r`.`created_at` as date) = (curdate() - 1))) AS DATE_FORMAT(curdate(),'%a %e') 
</code></pre>

<p>I would like that in each column of sum, it appears</p>

<pre><code>Sunday | Monday | Tuesday | Wednesday
65       54       99        100
</code></pre>

<p>It can not be fixed, because every day will change.
Today is Sunday and will appear the dates of Saturday, Friday ...
But tomorrow is Monday then it should appear: Sunday, Saturday ....</p>

<p><strong>Tomorrow will be another result as below</strong></p>

<pre><code>Monday | Tuesday | Wednesday | Thursday
54       99        100         85
</code></pre>